GithubHelp home page GithubHelp logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Same issue on Mac/Safari + Firefox

Original comment by [email protected] on 9 Oct 2010 at 4:57

from google-maps-utility-library-v3.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
[deleted comment]

from google-maps-utility-library-v3.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
[deleted comment]

from google-maps-utility-library-v3.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.