A custom tag library to provide general GoogleMaps API capabilities. Google recently released it's wonderful GoogleMaps API to the public. GoogleMaps API is a javascript/AJAX application that provides dynamic, interactive mapping and satellite capabilities for webpages. The possible uses are endless. Before using GoogleMaps and the GoogleMaps API JSP Tag Library you should read their Terms of Use and you will need to Register each domain that will use the API. While this tag library does not expose all the possibilities of the GoogleMaps API, it provides good functionality without the need to learn the API, advanced Javascript or AJAX, and provides a familiar JSP tag library interface. What this tag library provides that GoogleMaps API does not provide is some geolocation capabilities. Geolocation is the practice of converting a physical location to a longitude/latitude pair. The GoogleMaps API JSP Tag Library allows you to specify a location by any of the following, not just Longitude and Latitude pairs:
- Longitude & Latitude
- IP Address
- US Zipcode
- City and State (Province)
- Street Address
It also provides built-in capabilities to draw circles, boxes and polygons that the standard API does not contain. The GoogleMaps API JSP Tag Library also provides mousewheel handling that the default GoogleMaps API does not. The tags fit into 2 categories: 1) Data tags that provide the data needed to create a map and 2) Display tags that generate the actual HTML, Javascript and AJAX output. The following tags make up the data portion of the tag library: - <googlemaps:map>
This is the top level tag and is parent to all the other data tags, except the <googlemaps:infowindow> tag which is child to the <googlemaps:marker> tag. - <googlemaps:key>
Where you define the GoogleMaps API key for the domain hosting this map. You can register for a key here - <googlemaps:point>
This tag represents a location on the map. It has no output, but is used in all the other tags (except <googlemaps:infowindow>) as plotting points. - <googlemaps:marker>
This tag displays a marker on the map at the specified point. - <googlemaps:infowindow>
This tag defines a cartoon dialog style window that appears over a marker. - <googlemaps:tabbedInfoWindow>
This tag defines a cartoon dialog style window that appears over a marker and contains multiple tabs. - <googlemaps:tab>
This tag defines a single tab within a tabbedInfoWindow. - <googlemaps:blowup>
This tag defines a cartoon dialog style window that contains a map blowup of the marker's position. - <googlemaps:event>
This tag defines an action listener for clicks on this marker. - <googlemaps:icon>
This tag defines a custom icon for this marker. - <googlemaps:maptype>
Defines a custom map type for this map. - <googlemaps:message>
Defines a message window that appears on loading and event triggers. - <googlemaps:circle>
Draws a circle with a given radius around the specified point. - <googlemaps:event>
This tag defines an action listener for clicks, drags, zoom and type changes on this map. - <googlemaps:polygon>
Draws a closed polygon using the specified points (in order) as plotting points. - <googlemaps:polyline>
Draws a polyline using the specified points (in order) as plotting points. - <googlemaps:traffic>
Plots markers that relate to traffic events within the given radius. - <googlemaps:icon>
This tag defines a custom icon for events found in given radius. - <googlemaps:body>
For future use allowing users to define custom controls. - <googlemaps:overviewControl>
Displays a small overview window inside the map. - <googlemaps:panControl>
Turns on or off the paning controls on the map. - <googlemaps:typeControl>
Turns on or off the map type (map, satelitte or hybrid) controls. - <googlemaps:wheelControl>
Turns on or off mousewheel scrolling capabilities. Requires the map version be set to 1. - <googlemaps:zoomControl>
Turns on or off the zoom control. If set to large the zoom slider is also displayed. The following tags represent the display portion of the tag library. They must be placed after the <googlemaps:map> tag and have specific places they must be put: - <googlemaps:scripttag>
Generate the script tag that imports the GoogleMaps™ API. This tag should be in the <head> section, anywhere after the <googlemaps:map> tag. - <googlemaps:javascript>
Generates the javascript and AJAX portion of the map. This should be in the <head> section, but either way must be after the <googlemaps:scripttag> and outside any <table> and other formatting tags to ensure compatibility with Internet Explorer. - <googlemaps:div>
This is the visual map. This tag can be anywhere in the <body> section, after the <googlemaps:javascript> tag. - <googlemaps:initialize>
Generates the javascript code that initializes the map and connects the mousewheel (if applicable). This tag must be after the <googlemaps:div> tag and should be the very last tag before the closing </body> tag. Future versions of this tag library will provide driving directions, course plotting and much more. Stay tuned!
|