scroll - Google Maps v3 ImageMapType Prevent Wrapping -


i trying replicate behavior seen at:

http://forevermore.net/articles/photo-zoom/

it allows panning , zooming of photo, limits panning bounds of photo.

the example above using google maps v2 code.

it seems have following:

google.maps.event.addlistener(map, 'dragend', function()  {     //get bounds , not allow dragging  }); 

(as seen here: how limit panning in google maps api v3?)

my problem is:

  • images panned/zoomed dynamic in size, want generic solution (if possible)

if not possible have generic solution, how determine correct latlon bounds image?

here have far:

var customtypeoptions = {   gettileurl: function(coord, zoom) {         return "img/earth_tiles/tile-" + zoom + "-" + coord.x + "-" + coord.y + ".jpg";   },   tilesize: new google.maps.size(256, 256),   maxzoom: 6,   minzoom: 0,   name: "custom map type" };  var custommaptype = new google.maps.imagemaptype(customtypeoptions);   jquery(document).ready(function(){   var mylatlng = new google.maps.latlng(0, 0);   var myoptions = {     center: mylatlng,     zoom: 3,      disabledefaultui: true,      zoomcontrol: true   };    var map = new google.maps.map(document.getelementbyid("map"), myoptions);     map.maptypes.set('custom', custommaptype);     map.setmaptypeid('custom'); }); 

it works fine, allows user scroll outside of photo.

to honest, don't think using google maps right approach. yes, can hack working, it's not library meant do. (something using hammer fit round screw triangular hole.)

additionally, you're subjecting both google's restrictive terms (your site must public) , new pricing, means on 25,000 pageviews/day cost — , you're not using maps.

instead, why not use library designed tiled zooming of large images? panojs3 seems fit bill.

panojs3 - interactive javascript widget panning , zooming panoramic image stitched dynamically smaller tiles. widget can used viewing images larger available space in browser viewport. examples include panoramas, maps or high resolution document scans.

panojs3 supports native navigation on popular platforms:

  • pcs (zooming using mouse scroll, same google maps)
  • macs (2d panning mouse scroll or touch panels)
  • mobile devices touch interfaces: ios , android (supports pintch zoom , pan gestures)
  • phones , tablets (scales controls according screen size)

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -