www.skylinesoft.com Homepage
Forum Home Forum Home > SkylineGlobe Enterprise Products > TerraExplorer for Developers
  New Posts New Posts RSS Feed - WMS
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

WMS

 Post Reply Post Reply
Author
Message
adityagis View Drop Down
Visitor
Visitor


Joined: July 01 2010
Location: India
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote adityagis Quote  Post ReplyReply Direct Link To This Post Topic: WMS
    Posted: July 17 2010 at 10:50am
How to add the WMS layer programetically???
Back to Top
Eylon View Drop Down
Skyline Admin Group
Skyline Admin Group
Avatar

Joined: May 05 2003
Location: Israel
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eylon Quote  Post ReplyReply Direct Link To This Post Posted: August 12 2010 at 2:57pm
Here is an example.
It needs some adjustments to work with differnt servers (for the BBOX etc.) but shows the general technique:

<html>
    <head>
        <title>Create Model</title>
        <script src="skyline:sgapi.js"></script>
        <script language="jscript">
       
        var globe = null;
       
        function Init()
        {
            globe = new SGWorld();
           
var x1=-180;
var y1=90;
var x2=180;
var y2=-90;
var LayerName = "My WMS layer";

var wmsFile =
"[INFO]" + "\n" +
"Meters=0"  + "\n" +
"MPP=2.68220901489258E-06"  + "\n" +
"Url=http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&Version=1.1.1&Service=WMS&BBOX=0,0,0,0&SRS=EPSG:4326&HEIGHT=0&WIDTH=0&Layers=global_mosaic_base&Styles=pseudo&Format=image/png"  + "\n" +
"xul=-180"  + "\n" +
"ylr=-90"  + "\n" +
"xlr=180"  + "\n" +
"yul=90"  + "\n";
//alert(wmsFile);
globe.teCore.IObjectManager.CreateImageryLayer( LayerName ,x1,y1,x2,y2,"<EXT><ExtInfo><![CDATA[" + wmsFile + "]]></ExtInfo><ExtType>wms</ExtType></EXT>","gisplg.rct",0,LayerName);
            
        }
        </script>
    </head>
    <body onload="Init();">
    </body>
</html>
Eylon
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.031 seconds.