开发者

Google maps Zoom Effect

I am busy with creating a Google map v开发者_运维技巧3 site. If you have a look on google maps site you see they physically zoom(CSS like deepzoom) the tile just before they load the new tiles.

I want to reproduce this on my side. The problem is i cant find anything in API reference that i can do this with. I thought of creating a imagemaptype and just get the node of the img tag and do a css zoom on it and the call the normal maptype gettile but to no avail. I try using bound_change to see if the bounds change but i cant get the actual node(img tags).

Any help will be appreciated

thanks


In the v2 API you could call the GMap2.enableContinuousZoom() method to enable this feature. In the v3 API there is no such method as this feature is enabled by default in browsers that support it.

  • Source and further reading: Issue 2079: Continuous zoom: Comment #8

I tried the following short example in Chrome 5.0.375.99 and Firefox 3.6.6 (both for Mac), and only the map in Chrome came with continuous zoom enabled:

<!DOCTYPE html>
<html> 
<head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
  <title>Google Maps v3 Continuous Zoom</title> 
  <script src="http://maps.google.com/maps/api/js?sensor=false" 
          type="text/javascript"></script>
</head> 
<body> 
  <div id="map" style="width: 500px; height: 400px;"></div>

  <script type="text/javascript">

    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 6,
      center: new google.maps.LatLng(-41.00, 174.00),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

  </script>

</body>
</html>


I don't know if you can get it to behave exactly like their main Maps app, but this guy seems to have figured out a way to reproduce it: Google Maps zoomOut-Pan-zoomIn animation

It looks like the continuous zoom was available in v2 but I can't find much reference to zooming at all in v3. Curious... http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜