OverviewSince 3.2 The ace:gMap component, and the subcomponents that tie into it, are designed to provide a comprehensive implementation of the Google Maps Javascript API. 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.
Getting Started<ace:gMap address="Calgary, Alberta" style="height:500px; width:800px;"/> Attributes
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 subcomponentsThe 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.
License KeyThe 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:
Source: https://developers.google.com/maps/documentation/javascript/usage 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. Javascript APIICEfaces 3.xThe client side component object is exposed through the global variable name specified in the widgetVar attribute. ICEfaces 4+The "widgetVar" attribute on the ACE components has been removed in ICEfaces 4 and in its place a new "ice.ace.instance()" client JavaScript object lookup API has been introduced. The reason for this change is to enable lazy-initialization of the ACE component JavaScript objects to improve runtime performance and reduce browser memory use. var widget = ice.ace.instance('frm:componentId);
RequiredIn 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. VersionBy 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. CSS ClassesThe 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> |
GMap
© Copyright 2021 ICEsoft Technologies Canada Corp.