yenbao1340 / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

js errors when trying to access marker that is off-screen #105

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load a lot of markers
2. Keep an independent list of markers
3. Call GMarker.openInfoWindow()  method for a marker that is off-screen
4. Try to change the marker color using .setImage()

What is the expected output? What do you see instead?

Expected OUTput: the screen should pan and possibly adjust zoom to bring
that marker into view.  Then the infowindow should open. The marker color
will be changed.

INSTEAD:  The map moves, but the infowindow usually doesn't open and the
marker does not get highlighted.  I get various JS errors:

MOST COMMON:
! this.Xa is not a function, line 834 in mapfiles/151e/maps2.api/main.js
(I get this if the infowindow does not open)

SOMETIMES:
! d not defined (also in main.js)
! a is null(also in main.js) line 529
I get this if the info window opens but the color is not changed)

Which error happens I guess depends on the density of markers and where is
the marker I want to open relative to the loaded markers, etc.

What version of the product are you using? On what operating system?

map 151e
MarkerManager (I tried 1.0 and 1.1).  The JS errors depend on the version.

Please provide any additional information below.

* I tried using setCenter to move the map before I call openInfoWindow() so
the MarkerManager has time to show the marker, but did not help.

* I also tried getMarker() but couldn't figure out how to use it.
It would be nice to have things like openInfoWindow work transparently, so
we don't have to worry about whether a marker is showing or not.  

* It would also be nice to have a way of accessing a single marker and
force it to be shown.

Notes on my application:
I have an application which uses thousands of markers.  I created my own
editor for it, which keeps its own collection of markers, each defined as
an object with a key and all the content.  Without the MarkerManager the
editor runs too slow, but it works correctly.  For example I edit one
marker, then I click next to the next marker.  If that marker is
off-screen, when I open the infowindow of that marker it moves the map to
bring it within bounds.

With the Marker Manager, performance is much faster, but I get frequent
crashes when I try to access a marker that is off-screen or out of zoom.

Original issue reported on code.google.com by ramiak2...@gmail.com on 23 Apr 2009 at 6:40

GoogleCodeExporter commented 8 years ago
Just want to add, the "d is undefined error", which is relatively rare (I get 
it when
I try the getMarker(), e.g.) is on line 551 of mapfiles/151e/maps2.api/main.js

Original comment by ramiak2...@gmail.com on 25 Apr 2009 at 1:40