The Google Maps API is a web-based service which requires that the client-browser has access to the Google Maps server via the internet.
<ace:gMap address="Calgary, Alberta" style="height:500px; width:800px;"/>
latitude and longitude represent the location the map should show, either upon rendering, or upon the submission of these values. zoomLevel defines the level of zoom that the map shows and type is used to set the type of map visible(roadmap, hybrid, satellite and terrain).
The map will automatically move to view the location specified in address in the event that the map is rendering, or locateAddress is true.
Options is a catchall attribute for the oher various options availible to a google map from the Google Maps API. It is done in the style of optionName:value, optionName:value... etc. A list of viable options can be found at the API documentation.
Relations to subcomponents
The ace:gMap component has a large number of subcomponents, each designed to affect the map in a specific way. All of these components must be nested within an ace:gMap tag in order to function.
The Google Maps API uses an optional license key to identify applications/servers to the gMap service for usage tracking purposes.
By default, the Google Maps API has usage limits in place, as below:
If an application requires more than that then a commercial agreement can be signed with Google and a specific Google Maps API key is issued for that.
The key is then specified in the web.xml file as follows:
<context-param> <description>Google Maps API key is required if gMap component is used. Sign up for an API key from http://code.google.com/apis/maps/signup.html</description> <param-name>org.icefaces.ace.gmapKey</param-name> <param-value>KEYGOESHERE&libraries=places</param-value> </context-param>
Note that the ICEfaces Showcase sample application includes a gMap API Key that is keyed to "localhost" for demonstration and testing purposes.
The client side component object is exposed through the global variable name specified in the widgetVar attribute.
var widget = ice.ace.instance('frm:componentId);
In order to function properly, ace:gMap must be able to access a Google Maps v3 API key. This can be achieved by setting a parameter 'org.icefaces.ace.gmapKey' to your key in your project's web.xml. A google maps v3 API key can be obtained for free here.
By default, ace:gmap will use the latest Google Maps version available. If an earlier version is preferred for a certain application, then the org.icefaces.ace.gmapVersion context parameter must be specified in web.xml with the desired version number as the value, as in this example:
<context-param> <param-name>org.icefaces.ace.gmapVersion</param-name> <param-value>3.21</param-value> </context-param>
In this case, the 3.21 version will be used, whose control styles are clearly different than in newer versions. Only versions that are still supported by Google can be used in this way.
The following markup represents the basic HTML structure of the component and the CSS classes it uses.
<div class="ice-ace-gmap [user defined classes]" style="[user defined styles]"> <div> <!-- Nodes added by Google Maps... --> </div> </div>
© Copyright 2021 ICEsoft Technologies Canada Corp.