GoogleMaps JSP Taglibrary  

Example 8 - Map Zoom

This map hears zoom events. Zoom events are triggered after users zoomed in or out on the map. If you click the zoom in (+) or zoom out (-) buttons, you'll see the resulting event:

http://www.lamatek.com/GoogleMaps/example_8.jsp?event=zoom&map=map1&zoom=xx

These parameters are provided:

  • map
    The id of the map that generated the event.
  • event
    The event type that was triggered (this example is zoom)
  • zoom
    The new zoom level of the map.
You may also notice that because we've reloaded the page and not processed the event the map is still at the old zoom level. We'll discuss this more later.

Here's the code we used:

  <googlemaps:map id="map1" width="250" height="300" version="2" 
  			type="STREET" zoom="12">
	  <googlemaps:key domain="www.lamatek.com" key="xxxxx"/>
	  <googlemaps:point id="point1" address="74 Connors Lane" 
	  		city="Elkton" state="MD" zipcode="21921" country="US"/>
	  <googlemaps:event action="zoom" url="/GoogleMaps/example_8c.jsp"/>
	  <googlemaps:zoomControl enable="true" size="small"/>
	  <googlemaps:message>
		<img src="/GoogleMaps/images/loading.gif"/> Please wait...
	</googlemaps:message>
  </googlemaps:map>
  

Our next example examines the maptypechanged event.

Google
Search for Google Maps technology:

Java JSP PHP ASP
Google™ and the GoogleMaps API are copyright of Google.