Developer guide for Google map API Professional Edition
Google map API allows you to add easy-to-use interactive maps to your public websites to improve customer experience by helping customers find what they really need from your organization. This is why this API has become the world's most popular map creation API. When Google Maps play an important role on your public website or have been incorporated into internal applicationsProgramFor your employees, the Organization needs an enterprise-level application to handle a large amount of work and provide necessary support.
- Why Google map API Professional Edition?
- Specify "client ID"
- Use
Sensor
Parameter tracking usage
- Access and load APIs
- Use
Client
Parameter loading javascript API
- Use a common loader to load JavaScript APIs
- Load Google Maps API (for flash)
- Use the map API Service
- Static map API
- Address Resolution Service
- Supported
Why Google map API Professional Edition?
Google map API Professional Edition provides enterprise-specific application support to meet your map rendering application needs. TheCodeThe library is the same as the standard Google map API, but it also provides the following additional features and advantages:
- Powerful SLA)
- Customer Support
- Added address resolution restrictions
- Commercial Terms
- Enterprise intranet application support
- Through secureHTTPSConnect to access the API
Google map API Professional Edition requires you to register your website before you can access these additional features. For more information, contact us.
This document describes the specific use cases and coding problems of Google map API Professional Edition. For the complete documentation on all common code, refer to the existing Google map API documentation to use this guide.
Specify "client ID"
To access the special features of Google map API Professional Edition, you must provide the "client ID" when accessing any Professional Edition api library or service". When registering to use the Google map API Professional Edition, you can obtain this "client ID" from Google Enterprise Support". All client IDSGME-
Prefix.
Your client ID can be associated with one or more website domains. For existing customers, all domains associated with your professional account by publishing an API key are automatically added to your account. If you want to obtain a list of currently enabled domains or enable other domains for your client ID, contact Google Enterprise Support. The number of domains that can be enabled for your client ID is unlimited.
Note: The Client ID is not the key. It only works in the domain you authorize, so you do not need to worry about its confidentiality. When a Google Map API professional user uses the map API or a service, the user no longer needs to register or provide an API key.
Use
Sensor
Parameter tracking usage
When using the Google map API, You need to specify whether your application uses sensors (such as GPS locators) in any map api library or service requests to determine the location of the user. This is especially important for mobile devices. If the Google map API application uses any form of sensor to determine the location of the device accessing your application, you mustSensor
Set the parameter valueTrue
To declare this.
Please note that even if your application does not use any location sensor, you still need to setSensor
Parameters (in this example, setFalse
).
Access and load APIs
To load a map api library or service as a professional application, you must useClient
The parameter specifies the Client ID. The specific method for specifying this value depends on the library or service you are using.
Use
Client
Parameter loading javascript API
To use your Google map API professional Client ID to load the Google map javascript API, you need to add additional Client parameters to the URL used to retrieve the Javascript Library:
<SCRIPT src = "http://ditu.google.cn/maps? File = API & V = 2 & client =GME-yourclientid& Sensor = false "type =" text/JavaScript "/>
Please note that you do not need to provide the API key in this URL, but you must provideSensor
Parameters.
Google map API professional customers can also useHTTPSAccess the Google map javascript API. To passHTTPSTo use the Google map javascript API, Google Enterprise must first enable HTTPS access for your client ID. If your client is not allowed to useHTTPSThe request is redirected to HTTP.
To passHTTPSTo load the Google map javascript API, you must use HTTPS protocol and load the API from the following URL:
<SCRIPT src = "https://maps-api-ssl.google.com/maps? File = API & V = 2 & client =GME-yourclientid& Sensor = false "type =" text/JavaScript "/>
Use a common loader to load JavaScript APIs
Google map JavaScript APIs are now fully integrated with Google Ajax APIs, as described in the http://code.google.com/apis/maps/documentation/#AJAX_Loader.
If you want to use the Google map API professional Client ID to load the Google map javascript API, you do not need to provide the API key when loading the general-purpose Loader:
<SCRIPT type = "text/JavaScript" src = "http://www.google.cn/jsapi"/>
When using a common loader to load Google map JavaScript APIs, you must useOther_params
Options provide your client ID:
Google. Load ("maps", "2", {"other_params": "client =GME-yourclientid& Sensor = false "});
Google map API professional customers can also useHTTPSLoad the Google map javascript API. To passHTTPSTo use the Google map javascript API, Google Enterprise must first enable HTTPS access for your client ID.
To use the Google Ajax API to load a program throughHTTPSLoad the Google map javascript API first throughHTTPSLoad a General Loader:
<SCRIPT type = "text/JavaScript" src = "https://www.google.cn/jsapi"/>
After loading, you can useGoogle. Load ()
Load the Google map javascript API (as shown above ).
PassHTTPSWhen a request for a Google Map javascript API is submittedHTTPSThe access client ID is redirected to HTTP by using a general loader to load the map API.
Load Google Maps API (for flash)
Your Google map API professional Client ID also allows you to access Google Maps API (flash) in the form of enterprise applications ). For more information about Google Maps API (flash), visit http://code.google.com/apis/maps/documentation/flash /. Like JavaScript APIs, When you access this API, you do not need to provide an API key, but need to passClient
AndSensor
Parameters.
Note:Google Maps API (Flash version) removes the need to provide API keys for professional customers who use flash sdks no less than 1.8B. Make sure that your application is compiled with a version no less than 1.8B to facilitate access without providing a key. Existing applications need to be re-compiled with this version to enjoy the support without providing keys.
When you access the Google Maps API (flash), you can provide your Google Maps API professional Client ID in three ways. We recommend that you provide your client ID andSensor
Parameters:
Use your client ID and sensor parameter as the attributes of the UI container object declared in mxml:
<Maps: Map Xmlns: Maps = "Com. Google. Maps .*" ID = "Map" Mapevent_mapready = "Onmapready (event )" Width = "100%" Height = "100%" Sensor = "False" Client = " GME-yourclientid " />
This method is preferred if you use flexbuilder or flex framework to develop applications.
Use your client ID and sensor parameterObject
AndEmbed
Tag (used to add your flash application to a web page) properties to provide:
<Div ID = "Map_canvas" Name = "Map_canvas" > <Object Classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" Codebase = Http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" Width = "800px" Height = "600px" > <Param Name = "Movie" Value = "Helloworld.swf" > <Param Name = "Quality" Value = "High" > <Param Name = "Flashvars" Value = "Client = GME-yourclientid & Amp; sensor = false" > <Embed Width = "800px" Height = "600px" SRC = "Helloworld.swf" Quality = "High" Flashvars = "Client = GME-yourclientid & sensor = false" Pluginspage = Http://www.macromedia.com/go/getflashplayer" Type = "Application/X-Shockwave-flash" > </Embed> </Object> </Div>
-
the Client ID and sensor parameters can be directly used as attributes of the Map
Object using the ActionScript code:
var Map : Map =
New Map (); Map . Sensor =
false ; Map . client =
" GME-yourclientid " ;
This method is required if you use Flash CS3 to develop applications.
Google Maps API (Flash version) is not enabled yetHTTPS.
Use the map API Service
Google map API professional client id not only allows you to access JavaScript APIs supported by enterprises, but also allows you to access any existing Google map API service. You can use these services with the Professional edition to obtain more access permissions and support.
Static map API
Google static map API allows you to construct and retrieve map images using the parameters passed by its URL service. For the complete Google static map API documentation, visit http://code.google.com/apis/maps/documentation/staticmaps /. Static map API requests using the professional Client ID have higher query restrictions.
To use the Google map API professional Client ID to embed a map image in a webpageClient
The parameter is appended to the static map URL. Please also pass itSensor
Parameter value.
HTTP:// Ditu.google.cn/staticmap? Center = 40.714728,-73.998672 & zoom = 12 & size = 400x400 & client =GME-yourclientid& Amp; sensor = false
Note that you do not need to pass the API key.
Google map API professional customers can also useHTTPSSend a request to the static map API. To passHTTPSTo use the static map API, Google Enterprise must first enable HTTPS access for your client ID.
To embed a map image into a secureHTTPSTo connect to the retrieved webpage, use the alternate host name in your request URL, as shown below:
HTTPS:// Maps-api-ssl.google.com/staticmap? Center = 40.714728,-73.998672 & zoom = 12 & size = 400x400 & client =GME-yourclientid& Amp; sensor = false
NOTE: IfHTTPSUse Not EnabledHTTPSThe request is rejected and the 400 "error request" error occurs.
Address Resolution Service
The Google map Address Resolution Service allows you to request the longitude and latitude information for address query. For the complete Google HTTP address parser documentation, visit http://code.google.com/apis/maps/documentation/services.html#geocoding_direct.
To use the Google map API professional Client ID to parse the request address from the Google HTTP address parserClient
The parameter is appended to the URL of the address parser.
HTTP:// Ditu.google.cn/maps/geo? Q = 1600 + amphitheatre + Parkway, + mountain + view, + Ca & Output = xml & client =GME-yourclientid & sensor = false
Please note that you do not need to provide the API key in this URL, but you must provideSensor
Parameters.
Google map API professional customers can also useHTTPSSend a request to the address resolution service. To passHTTPSTo use the Address Resolution Service, you must first enable HTTPS access for your client ID supported by Google Enterprise.
To passHTTPSUse the Google HTTP address parser to request address resolution. Use the alternate host name in your request URL, as shown below:
HTTPS:// Maps-api-ssl.google.com/maps/geo? Q = 1600 + amphitheatre + Parkway, + mountain + view, + Ca & Output = xml & client =GME-yourclientid & sensor = false
IfHTTPSUse Not EnabledHTTPSThe client ID sends a request to the map API Address Resolution Service, and 610 (G_geo_bad_key
) Address parser response. If the request exceeds your daily throughput limit and immediate throughput limit, 620 (G_geo_too_many_queries
).