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 13
13
< script id ="source " language ="javascript " type ="text/javascript ">
14
14
//The raster layer properties dialog will pass an object 'mRasterLayer'
15
15
//to this javascript context which you can interrogate for all its metadata
16
+ //and invoke any of its slots
16
17
function showJson ( )
17
18
{
18
19
if ( typeof mRasterLayer === 'undefined' )
22
23
else
23
24
{
24
25
//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 ( ) ;
26
29
}
30
+
27
31
}
28
32
/** Load the metadata object passed into this page from c++ context using
29
33
wvMetadata->page()->mainFrame()->addToJavaScriptWindowObject( "mRasterLayer", mRasterLayer );
@@ -42,8 +46,9 @@ <h1>Metadata</h1>
42
46
< div id ="metadata " class ="span-24 "> </ div >
43
47
</ hr >
44
48
< 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 >
46
50
< div id ="notes " class ="span-24 "> </ div >
51
+ < button onclick ="showJson() " > Show scale range</ button >
47
52
</ div >
48
53
</ body >
49
54
</ html >
You can’t perform that action at this time.
0 commit comments