User Tools

Site Tools


map_suite_desktop_for_wpf_how_to_use_googlemaps

This is an old revision of the document!


Map Suite Desktop For Wpf How to Use Googlemaps

Note: If you are using Map Suite 9.0 or previous versions of Map Suite product, please go to MapSuite 9.0 Wiki. The current page is for Map Suite 10.0 and future versions. It has different assemblies, licensing strategy and ways of distribution, and more. although the majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code to Map Suite 10, please check out MapSuite 10 Upgrade Guide.

This guide helps you to create a google maps key and apply it in Map Suite.

Getting Started

Google offers two types of API plan. One is standard Google Static Maps API, the other one is Google Maps APIs Premium Plan license. Each of them have two usages.

Standard Google Static Maps API

  1. Use API Key
  2. Use API Key and signature

Google Maps APIs Premium Plan

  1. Use API Key and signature
  2. Use ClientID and signature

How to Get API Key

  1. Login your Google account. ( Note: If you do not have one, create one then login. )
  2. Create or select the project that will be using the API.
  3. Search for “Google Static Maps” and enable the API.
  4. Go to Credentials page, click create a credential, and select API key. ( Note: if you have an existing unrestricted API key, or a key with browser restrictions, you may use that key. )

Read more details about how to get a key.

How to get Signature & ClientID

You can read more details about how to get the Signature and ClientID.

Code Sample

How to Apply Key

<pic1>

  1. Open the app.config file.
  2. Place the key to the appropriate field. (see pic1 above)

Code Usage

  // Google maps core by using GoogleMapsOverlay()
  GoogleMapsOverlay googleMapsOverlay = new GoogleMapsOverlay();
  googleMapsOverlay.SendingWebRequest += GoogleMapsOverlay_SendingWebRequest;
  googleMapsOverlay.MapType = GoogleMapsMapType.Satellite;
  googleMapsOverlay.Name = "Google Maps Satellite";
  googleMapsOverlay.IsVisible = false;
  wpfMap1.Overlays.Add(googleMapsOverlay); 
  
  // where you can add the keys 
  <appSettings>
    <add key="BingMapKey" value="Place Your Bing Maps Key Here" />
  </appSettings>


map_suite_desktop_for_wpf_how_to_use_googlemaps.1522358564.txt.gz · Last modified: 2018/03/29 21:22 by cloudhu