<< Click to Display Table of Contents >>

 

Bing Maps Adding SuperGIS Server Map Service to Bing Maps

 

 

1.Find WebTile.aspx under the BingMap virtual directory created in previous section and open the file to edit with Notepad or other text editor.

 

2.Find the URL that connects SuperGIS Server in Page_Load function and change the original URL that connects to localhost to IP address of SuperGIS Server you created (the bold texts in blue).

 

………

private void Page_Load(object sender, EventArgs e)

{

String strUrl = @"http://xxx.xxx.xxx/sgspws/SGSPAgent.ashx";

List<double> dScaleFacs = Session["ScaleFactors"] as List<double>;

………

 

 

3.SuperGIS Server URL is now changed; consequentially we need to set up the map service you published as the SuperGIS Server service. For instance, if a service named TW is published under SuperGIS Server public folder, please change public\world.cfg to public\TW.cfg in code and save it (the bold texts in blue).  

 

………

if (dScaleFacs == null)

{

   MemoryStream ms = SendRequest(strUrl + "/GetResource", @"ResourceName=public\TW.cfg");

   XmlDocument xDoc = new XmlDocument();

………

 

 

4.After that, we need to change the link to MapCache image of SuperGIS Server MapCache Service. Like Step 2, simply change the service name to the MapCache map service you have published in ResourceName. For instance, change public\\world.cfg to public\\TW.cfg and save it(the bold texts in blue).

 

………

if (Math.Round(Math.Log(fac / sf) / ln2) == 0)

{

   String strPost = String.Format("ResourceName=public\\TW.cfg&LayerIndex={0}&ScaleIndex={1}&XIndex={2}&YIndex={3}", nLIndex, i, nXIndex, -nYIndex - 1);

………

 

 

5.After modified, open the website browser, enter the website link (http://localhost/BingMaps/sample.htm)and click Enter, now you can view SuperGIS Server map service on Bing Maps website.

 

 

NOTE: To browse complete Bing Maps please connect to http://www.bingmapsportal.com/ and register for Bing Maps Key and then paste Key value to website code.

 

 


© 2012 SuperGeo Technologies Inc. All Rights Reserved.