markerclusterer

Google Maps JavaScript API v3 / Data Layer / MarkerClusterer

陌路散爱 提交于 2019-12-01 00:45:13
Can you help me please to create marker cluster with MarkerClustererPlus. I load the data with: layer = map.data.loadGeoJson('resources/data.geojson'); and the markers are visible, but i have not idea how to create markercluster. Do i have to parse the data.geojson-file into an array? Thanks. function initialize() { map = new google.maps.Map(document.getElementById('map'), mapOptions); layer = map.data.loadGeoJson('resources/data.geojson'); map.data.setStyle({icon: icon}); map.data.addListener('click', function(event) { var myHTML = event.feature.getProperty('name'); infobox.setContent("<div

Google Maps API V3 -> Utilize MarkerCluster but have the clusters themselves be specific to a drawn polygon/region?

江枫思渺然 提交于 2019-11-30 20:56:47
问题 Ok, let me preface this question with the fact that I have created a lot of google maps, but they have been strictly markers and polylines denoting routes and a couple with some handler interaction. Now I am looking to show basically a map of the world, mostly North America and I want to split this continent into my predefined regions with some lats/lngs that I have. Using these regions I want to draw something like a polygon with a light opacity and different color per region. I then want to

Fire event after MarkerClusterer has finished

独自空忆成欢 提交于 2019-11-30 20:19:49
So I have an application that contains a map with (several hundreds) of markers. I use the markerclusterer.js supplied by Google to cluster my markers and make the whole thing easier to look at. I'm using API V3. I'm fine with all of that. But what I would like to do is perform some action when the markerclusterer has finished clustering all the markers. I've tried to do it myself but with no look. Any suggestions? (I'm assuming this will be easier than I think and my brain is just fried) I was just wondering the same thing. This is how I did it: google.maps.event.addListener(markerClusterer,

Refreshing makers (ClusterItems) in Google Maps v2 for Android

我怕爱的太早我们不能终老 提交于 2019-11-30 12:38:18
I'm using Google Maps Android API Utility Library and I'm downloading certain images from internet that I want to use as markers. The way I'm doing it is like in the following snippet: class MarkerItemClusterRenderer extends DefaultClusterRenderer<MarkerItem> { ... @Override protected void onBeforeClusterItemRendered(MarkerItem item, final MarkerOptions markerOptions) { super.onBeforeClusterItemRendered(item, markerOptions); mImageLoader.get(item.getImageUrl(), new ImageListener() { @Override public void onErrorResponse(VolleyError error) { Log.i("XXX", error.toString()); } @Override public

Google MarkerClusterer: decluster markers below a certain zoom level?

爷,独闯天下 提交于 2019-11-30 08:09:15
I'm using Google MarkerClusterer. I'd like to decluster all the markers whenever the map goes above zoom level 15. There is a maxZoom setting in the configuration options, but the documentation does not make it clear what it is supposed to do . I have tried setting it as follows, but the map remains clustered whatever zoom level I set the map to: new_mc = new MarkerClusterer(map, newco_markers, { maxZoom: 9 }); Am I doing something wrong, have I misunderstood what the option is supposed to do, or is there another way to fix this? Setting the maxZoom level on this example , declusters all the

How to hide and show MarkerClusterer in google maps

梦想与她 提交于 2019-11-30 07:18:04
i'm trying to hide/show markerClusterer when user clicks some buttons: Here is what i'm trying to do: map = new google.maps.Map(document.getElementById("mappa"),mapOptions); var marker_tmp = []; var markers_tmp = []; $.each(json,function(index,value){ var latLng = new google.maps.LatLng(value.lat,value.lng); var marker = new google.maps.Marker({'position': latLng}); if((value.candidato in markers_tmp)==false){ markers_tmp[value.name]=[]; } markers_tmp[value.name].push(marker); }); for(var name in markers_tmp){ markers[name]= new MarkerClusterer(map,markers_tmp[name]); } I create multiple

Google Maps V3 rendering over 1 million markers (in a reasonable time)

旧城冷巷雨未停 提交于 2019-11-30 07:02:13
I have recently created a Google Map using V3 of the API (latest version). One of my requirements is that I am able to render over 1 million markers (in a reasonable time). A reasonable time would be under 15 seconds. I know that it is fairly crazy to render all 1 million markers at once which is why I have investigated performance options. One of the options I came across and utilized is the MarkerClusterer: https://developers.google.com/maps/articles/toomanymarkers However, I am now starting to see performance issues when testing the MarkerClusterer with over 100,000 markers as it is taking

Integrating Spiderfier JS into markerClusterer V3 to explode multi-markers with exact same long / lat

谁都会走 提交于 2019-11-29 21:00:52
I am using markerCLusterer V3 on a db file from Filemaker to generate a (semi-live) map of current delivery locations, based off of addresses. Grabbing the lat/long from Google and populating those fields is no problem. Generating the map via markerClusterer is no problem. I am even hosting the JS locally so that I can change the maxZoom variable to break the clusters apart above max zoom, so that I can see multiple markers. However, with the markers at exactly the same lat / long, I can only see the last one entered. I would like to integrate OverlappingMarkerSpiderfier into this JS so that

How can I cluster markers without overlap with google maps?

走远了吗. 提交于 2019-11-29 15:39:40
I am currently clustering hundreds of markers on my google maps. Many of the markers are based on geo-coded addresses, which at times only resolve to the city level. Normally i will end up with lets say a few hundred addresses all with the same lat lon for example in the middle of New York City. I know about the Marker Clustering in google maps, however when all the markers have the same lat long, you loose the ability to click on each marker, and bring up a popup. How can I manage these markers in such a way when you zoom in you can still tell how many markers there are, and still click on

Google Maps v3 MarkerClusterer not Clustering

你离开我真会死。 提交于 2019-11-29 11:40:20
I've looked at the docs and can't figure it out. I'm sure I'm missing something stupid. No errors, but no clustering. I tried to take the simple example from here and add it to the map I was already working on, with no success. If possible, I'd like to keep the meat of the map the same. I've also looked at several other questions here with no luck. If anyone could help me out I would be very very grateful. <!DOCTYPE html> <html> <head> <style> #map_canvas { width: 800px; height: 500px; background-color:#CCC; } #legend { font-family: Arial, sans-serif; background: #fff; padding: 10px; margin: