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.
|See the ICEfaces Showcase Live Demo of this component, complete with source code.|
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.
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.
- ace:gMapControl is a more intuitive approach to modifying the controls that appear on the map. Using this, users can specify which controls render, as well as the location of those controls that do appear.
- ace:gMapInfoWindow displays a pop-up window that can display either straight text information, or nested html code. If placed within a gMap, it will render at the locations given by its latitude and longitude attributes. If it is placed inside an ace:gMapMarker, it will bind to that marker and move to whatever location it occupies.
- ace:gMapLayer activates a layer on the parent gMap that's designed to provide an alternative visual, such as displaying bike paths, traffic, or third-party KML data.
- ace:gMapMarker places a marker upon the map in the desired coordinates to be used for designating points of interest or important locations.
- ace:gMapOverlay allows the user to create a shape of their choosing on the map.
- ace:gMapServices is an access point to the services portion of the api and will return information about the specified points, such as maximum zoom, or height. Directions are also specified through this subcomponent.
- ace:gMapAutocomplete uses the google places api to create a text-box that will auto-complete location entries, centering the map to the location chosen and returning information to specified variables in the backing bean. NOTE: To use this component, you must append 'libraries=places' to the end of your gMap key in the web.xml document.
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:
Web sites and applications using each of the Maps API may at no cost generate:
up to 25,000 map loads per day for each API
up to 2,500 map loads per day that have been modified using the Styled Maps feature
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.
We recommend that users generate their own API keys for use with their production applications, as per the instructions here: http://code.google.com/apis/maps/signup.html
The key is then specified in the web.xml file as follows:
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.
|The ice.ace.instance function requires the full client id of the component to be specified, such as "j_idt77:componentId" instead of just "componentId". To reduce the complexity of working with complete IDs with this function it may be preferable in some cases to use prependId="false" in the enclosing form (e.g. <h:form prependId="false">).|
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.
The following markup represents the basic HTML structure of the component and the CSS classes it uses.