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