File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 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' )
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 >
You can’t perform that action at this time.
0 commit comments