<< Click to Display Table of Contents >>

 

Adding Google Map as base map on SuperGIS Server map website

 

 

 

1.

Utilize notepad or other text editors to open SGSWebApp.htm file under the website directory that was built earlier. (The default directory path: C:\Inetpub\wwwroot\name of service.) And then add the code of Google Map API (code in bold and blue below) and put APIKey (code in bold and red below) into <script>.  

 

………

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

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

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

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=APIKEY"></script>

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

<script>

 

var gMapBase = null;

function InitWnd()

………

 

NOTE:To use Google Map please connect to https://developers.google.com/maps/documentation/directions/get-api-key  and register for Google Map API Key.

 

 

2.

Then search pMapBase.AddLayer(pLyr), and insert the code for adding Google Map  (code in bold and blue below).

 

NOTE:Code for adding Google Map layer must be written before code for adding SuperGIS Server layer.

 

 

………

 

pMapBase.AddLayer(new GoogleLayer());

pMapBase.AddLayer(pLyr);

………

 

 

 

3.

Save SGSWebApp.htm after finishing settings above, and open browser to connect SuperGIS Server website. You will find that Google Map layers and SuperGIS Server map are overlaid and demonstrated on SuperGIS Server map website.

 

 

NOTE: If you want to provide a better interface for mobile users, you need to follow the steps above and change contents of SGSMobileApp.htm.

 

 


©2017 Supergeo Technologies Inc.