-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SlidingMarker doesn't define MAX_ZINDEX #18
Comments
Ok, let's think how to resolve this issue. google.maps.Marker.MAX_ZINDEX Now, please provide your code that causes the problem. |
That's exactly my problem. // Replace standard markers
console.log(google.maps.Marker.MAX_ZINDEX); // 1000000
SlidingMarker.initializeGlobally();
console.log(google.maps.Marker.MAX_ZINDEX); // undefined -> problem
map = new google.maps.Map(document.getElementById('map_canvas'), {
zoom: 12,
mapTypeId: google.maps.MapTypeId.HYBRID
});
// last version 2017/05/02 : https://github.com/jawj/OverlappingMarkerSpiderfier. Not the version you provide (I haven't tested it).
// broken because it needs google.maps.Marker.MAX_ZINDEX to promote spiderfied markers : they stay at their initial z-index.
var oms = new OverlappingMarkerSpiderfier(
map,
{
markersWontMove: true,
markersWontHide: true,
basicFormatEvents: true,
keepSpiderfied: true,
circleFootSeparation: 23*1.5, // default = 23
spiralLengthStart: 11*1.5, // default = 11
nearbyDistance: 20*1.5, // default = 20
}
); A quick fix which works for me, is to add this code at the end of decorates function of slidingmarker.js file : var decorates = function (childCtor, parentCtor) {
// [...]
childCtor.MAX_ZINDEX = GoogleMarker.MAX_ZINDEX; // quick and dirty fix
}; That's certainly not the right way. And other properties may be missing, but I'm not affected. |
An external solution (without modifying your library) is simpler, directly in my code : var MAX_ZINDEX = google.maps.Marker.MAX_ZINDEX;
SlidingMarker.initializeGlobally();
google.maps.Marker.MAX_ZINDEX = MAX_ZINDEX; |
Oh, sure this is a bug. I will try to fix it ASAP. |
SlidingMarker doesn't define this property.
Replacing Google Marker globally by using SlidingMarker.initializeGlobally, breaks some code. For exemple, the last version of OverlappingMarkerSpiderfier library.
The text was updated successfully, but these errors were encountered: