Skip to content

Commit 1b6e10d

Browse files
committedNov 27, 2011
Merge branch 'master' of github.com:timlinux/Quantum-GIS
2 parents 301d207 + 191fb22 commit 1b6e10d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎resources/html/qgsrasterlayer.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<script id="source" language="javascript" type="text/javascript">
1414
//The raster layer properties dialog will pass an object 'mRasterLayer'
1515
//to this javascript context which you can interrogate for all its metadata
16+
//and invoke any of its slots
1617
function showJson()
1718
{
1819
if (typeof mRasterLayer === 'undefined')
@@ -22,8 +23,11 @@
2223
else
2324
{
2425
//for fun lets pickle the raster layer as a json object
25-
$("#notes").html(JSON.stringify(mRasterLayer));
26+
//$("#notes").html(JSON.stringify(mRasterLayer));
27+
//also you can use any slots as native jscript methods:
28+
$("#scale-range").hide().html("Minumum Scale: " + mRasterLayer.minimumScale() + " to Maximum Scale: " + mRasterLayer.maximumScale() ).slideToggle();
2629
}
30+
2731
}
2832
/** Load the metadata object passed into this page from c++ context using
2933
wvMetadata->page()->mainFrame()->addToJavaScriptWindowObject( "mRasterLayer", mRasterLayer );
@@ -42,8 +46,9 @@ <h1>Metadata</h1>
4246
<div id="metadata" class="span-24"></div>
4347
</hr>
4448
<div id="footer">Generated by Quantum GIS (http://qgis.org)</div>
45-
<button onclick="showJson()" >Show JSON</button>
49+
<div id="scale-range" class="span-24"></div>
4650
<div id="notes" class="span-24"></div>
51+
<button onclick="showJson()" >Show scale range</button>
4752
</div>
4853
</body>
4954
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.