Comments (7)
Same issue on Mac/Safari + Firefox
Original comment by [email protected]
on 9 Oct 2010 at 4:57
from google-maps-utility-library-v3.
Are you still seeing a problem if you try the latest version?
Original comment by [email protected]
on 31 Mar 2011 at 6:03
- Changed state: NeedsMoreInfo
from google-maps-utility-library-v3.
[deleted comment]
from google-maps-utility-library-v3.
[deleted comment]
from google-maps-utility-library-v3.
It seems the following is happening:
1. When the maximum zoom level is reached, the map zoom_changed event is fired.
2. That results in cMarkerClusterer.resetViewport_(false) being called, which
removes all the markers/cluster icons from the map.
3. The map idle event is *not* called (since the zoom level has not changed,
since we are at the maximum zoom level), which results in markers/cluster icons
not being recreated.
I think the zoom_changed event shouldn't be fired in the first place.
The following workarrounds work for me, I'm not sure if it's the most clean way
to tackle the issue though:
// Add the map event listeners
var resetViewport = false;
this.listeners_ = [
google.maps.event.addListener(this.getMap(), "zoom_changed", function () {
resetViewport = true;
}),
google.maps.event.addListener(this.getMap(), "idle", function () {
if (resetViewport)
cMarkerClusterer.resetViewport_(false);
cMarkerClusterer.redraw_();
})
OR
var lastZoom = this.getMap().getZoom();
var redraw = false;
this.listeners_ = [
google.maps.event.addListener(this.getMap(), "zoom_changed", function () {
if (this.getZoom() != lastZoom) {
cMarkerClusterer.resetViewport_(false);
redraw = true;
lastZoom = this.getZoom();
}
}),
google.maps.event.addListener(this.getMap(), "idle", function () {
if (redraw) {
cMarkerClusterer.redraw_();
redraw = false;
}
})
Original comment by [email protected]
on 16 Aug 2011 at 2:09
from google-maps-utility-library-v3.
Hi,
I had the same problem on one of my maps...
I solved it by using ">=" instead of ">"
Because, when we reach the maximum zoom, we need to display all the markers, we
can't cluster it anymore...
line 457 :
if (this.map_.getZoom() >= this.markerClusterer_.getMaxZoom())
Line 508
if (this.map_.getZoom() > this.markerClusterer_.getMaxZoom()) {
Also, i have another problem... When using an Hybrid map or a Satellite map..
Becase the real max zoom is not equal to the theorical one... in my case, the
theorical one is 22, and the real one is 19..
My problem is that the function to get the real zoom on hybrid or satellite map
is a asynchronous call to google servers.. and so, when my callback function is
called, i don't know anymore on wich cluster i asked (especially if i did
multiple requests..)
The fact is, my markers are so close that they could be separated only with a
big zoom... and the maximum zoom don't reach this level, so i need to display
them at the max zoom...
Hope the first part helps..
Hope the second one will find an answer...
Marc
Original comment by [email protected]
on 1 Sep 2011 at 6:52
from google-maps-utility-library-v3.
I have this on v2.0.7 also. The problem is that The maps API throws a
zoom_changed every time you click a zoom control, even if it doesn't result in
the zoom changing (duh!). I've worked around it in a similar way to the above
by adding a currentZoom property and a check/return in the zoom_changed
listener.
Original comment by [email protected]
on 26 Jan 2012 at 8:27
from google-maps-utility-library-v3.
Related Issues (20)
- White tiles in Chrome
- Add CLASS to IMG in infobubble.js
- MarkerClusterer: ClusterIconStyle - fontFamily and fontWeight not working
- MarkerWithLabel V3, cannot hide marker labels in V 1.1.0 HOT 2
- MarkerWithLabel: labelInBackground property doesn't work HOT 2
- MarkerWithLabel: dom elements inside labelContent HOT 1
- Scrolling on InfoWindow inconsistent between Firefox and Chrome HOT 2
- select tags not working inside richmarkers
- map cluster marker not loaded over https HOT 2
- Rendering issues with accuracy circle
- Ability to change datasets and recluster
- MarkerWithLabel with draggable=false doesn't fire mouseup event when clicking on label
- Markers is not shown properly if it is on same place using marker cluster.
- Retina icons are not rendered correctly by marker clusterer plus
- Broken image m1.png
- Patch for /trunk/infobox/src/infobox.js HOT 1
- Problem in setPosition
- Overlapping Labels
- Transit stations are still not clickable
- setPosition not working* HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-maps-utility-library-v3.