<< Click to Display Table of Contents >>

 

Adding SuperGIS Server map service into OpenLayers

 

 

1.Find out "sample.htm" file under the built virtual directory of OpenLayers and open it with notepad or other text compiler to edit it. In "InitWnd()"  you will find an URL which is connecting to SuperGIS Server. Replace this URL which is connecting to the localhost with the SuperGIS Server IP you built (IP in blue and bold below).

 

………

  <script type="text/javascript" src="SGSOpenLayers.js"></script>

  <script type="text/javascript">

      var _url = "http://xxx.xxx.xxx.xxx/sgspws/SGSPAgent.ashx";

      var _resource = "public\\world.cfg";

       function InitWnd()

       {

         var url = _url + "/GetResource?ResourceName=" + encodeURIComponent(_resource);

         LoadScript(url + "&Format=JSON", GetResource);

       }

………

 

 

2.After SuperGIS Server URL modifying, users also need to set up SuperGIS Server to publish map service. For example, to publish a "TW" service under "public" directory of SuperGIS Server, please replace "public\world.cfg" code with "public\TW.cfg"(code in blue and bold below) and click "Save."

 

………

  <script type="text/javascript" src="SGSOpenLayers.js"></script>

  <script type="text/javascript">

      var _url = "http://xxx.xxx.xxx.xxx/sgspws/SGSPAgent.ashx";

      var _resource = "public\\TW.cfg";

       function InitWnd()

       {

         var url = _url + "/GetResource?ResourceName=" + encodeURIComponent(_resource);

         LoadScript(url + "&Format=JSON", GetResource);

       }

………

 

 

3. After modifying, you will be able to view SuperGIS Server map service on OpenLayers website by entering the website address on the browser.

 

 

 


©2017 Supergeo Technologies Inc.