Skip to content

Commit 52eb8fd

Browse files
committedNov 24, 2011
Added the show scale range button
1 parent d219534 commit 52eb8fd

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
@@ -12,6 +12,7 @@
1212
<script id="source" language="javascript" type="text/javascript">
1313
//The raster layer properties dialog will pass an object 'mRasterLayer'
1414
//to this javascript context which you can interrogate for all its metadata
15+
//and invoke any of its slots
1516
function showJson()
1617
{
1718
if (typeof mRasterLayer === 'undefined')
@@ -21,8 +22,11 @@
2122
else
2223
{
2324
//for fun lets pickle the raster layer as a json object
24-
$("#notes").html(JSON.stringify(mRasterLayer));
25+
//$("#notes").html(JSON.stringify(mRasterLayer));
26+
//also you can use any slots as native jscript methods:
27+
$("#scale-range").hide().html("Minumum Scale: " + mRasterLayer.minimumScale() + " to Maximum Scale: " + mRasterLayer.maximumScale() ).slideToggle();
2528
}
29+
2630
}
2731
/** Load the metadata object passed into this page from c++ context using
2832
wvMetadata->page()->mainFrame()->addToJavaScriptWindowObject( "mRasterLayer", mRasterLayer );
@@ -41,8 +45,9 @@ <h1>Metadata</h1>
4145
<div id="metadata" class="span-24"></div>
4246
</hr>
4347
<div id="footer">Generated by Quantum GIS (http://qgis.org)</div>
44-
<button onclick="showJson()" >Show JSON</button>
48+
<div id="scale-range" class="span-24"></div>
4549
<div id="notes" class="span-24"></div>
50+
<button onclick="showJson()" >Show scale range</button>
4651
</div>
4752
</body>
4853
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.