Passing minZoom and maxZoom has no effect on zoom restrictions, any idea?
Simple google maps example without react-google-maps is ok
Any idea?
Put them in the options or defaultOptions property
Close for now.
We're also looking for maintainers. Involve in #266 to help strengthen our community!
@tomchentw when I put it in the options, it doesn't seem to work either
@woniesong92 @vvo
Add this parameters in options
maxZoom: 18, // for max zoom
minZoom: 2, // for min zoom
zoom: 2 // default zoom view
//Redraw after user zoom/drag interactions
google.maps.event.addListener(this.map, 'zoom_changed', _.bind(function() {
if (this.map.getZoom() > this.maxZoom) {
this.map.setZoom(this.maxZoom);
}
if (this.map.getZoom() < this.minZoom) {
this.map.setZoom(this.minZoom);
}
this.drawMap();
}, this));
google.maps.event.addListener(this.map, 'dragend', _.bind(function() {
this.drawMap();
}, this));
Following code is used for react-google-maps. Hope you get some help from this.
Is minZoom or maxZoom supported by the official Google Maps JavaScript API v3? If not, then use the solution proposed by @sameerkambli .
@tomchentw minZoom and maxZoom is supported by the official Google Maps Javascript API v3.
Most helpful comment
Put them in the
optionsordefaultOptionsproperty