Deeper scale needed in Google Maps API

We are developing a GIS application on top of Google Maps (using the Google Map API v3), but the application requires the user to get closer, because some of the map objects are small (up to 1 meter) and graphic editing will be required.

What is the best way to extend the zoom range in the Google Maps API, possibly to zoom level 30? Can we implement a shingles server that "takes over" when the Googles tilterver reaches the limit? Or is the Google Map API just using a graphical extension for zoom levels beyond what it has data for? Any other possible approach?

This problem is especially difficult when using a Hybrit or Satellite card, since they have a finer zoom level (it seems to be around 18 in our places).

The figure below shows the deepest scale and how it is not enough: enter image description here

/ Magnus

+4
source share
3 answers

This is how I finally solved it. Not an ideal solution, but good enough for my purposes:

  • Create and add a custom mapty type with empty fragments, but with high maximum magnification.
  • Connect to the mousewheel event before Google receives it (see here: Enabling the mousewheel event in the Google Maps API )
  • When zooming with the mouse wheel, check to see if maxZoom exists and if so, switch to a blank map (and check to switch when zooming). Since the mouse’s cam is before Google receives it, the zoom will not be interrupted even if the map type is changed.

The biggest problem was to determine if the map has maximum zoom (MaxZoomService works only for satellite images). I ended up with an ultra-ugly solution: checking the position of the zoon knob in zoom control :-)

0
source

A way to extend the zoom range is to create a custom MapType . Then you can specify minZoom and maxZoom . If your tiles on the map are regular images, you can use ImageMapType , which will do some accounting for you. Or you can use the full-blown custom MapType if necessary.

Here's an example of ImageMapType that has custom zoom and image levels.

0
source

This may be better than the code you use to view the scroll bar, because on small screens that may be different.

If the scale does not change, this means that Google has maximum scaling.

 var wheelEvent = function() { console.log('zoom before', map.getZoom()); setTimeout(function() { return console.log('zoom after', map.getZoom()); }, 0); }; })(this); $('#map-canvas')[0].addEventListener('mousewheel', wheelEvent, true); $('#map-canvas')[0].addEventListener('DOMMouseScroll', wheelEvent, true); 
0
source

Source: https://habr.com/ru/post/1501951/


All Articles