markerclusterer

Getting Google Map MarkerClusterer Plus Icons In One Color

▼魔方 西西 提交于 2019-12-18 05:45:07
问题 Can some one please let me know how to set MarkerClusterer plus to show all Clusters in One color? as you can see the MarkerClusterer automatically changes the color of the clusters when they are out on a range but I want get them all in one color? Thanks 回答1: Hi the colors are defined by the images which came with the cluster.js file Your images will range from m1.png to m5.png: Just copy the images and make them all the color which you want 回答2: I had similar problem. Solution: develop a

Refreshing makers (ClusterItems) in Google Maps v2 for Android

早过忘川 提交于 2019-12-18 04:10:40
问题 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

How to add info window for clustering marker in android?

旧时模样 提交于 2019-12-17 17:53:02
问题 I would like to show an info window with an image for all markers in Android. I referred to this Google Map Cluster Tutorial. 回答1: MyItem Class: import com.google.android.gms.maps.model.LatLng; import com.google.maps.android.clustering.ClusterItem; public class MyItem implements ClusterItem { private LatLng mPosition; private String mLatitude = ""; private String mStoreLogo = ""; private String mLongitude = ""; @Override public LatLng getPosition() { return mPosition; } public void

Clustering markers with google maps version 3

て烟熏妆下的殇ゞ 提交于 2019-12-13 11:02:35
问题 I have about 2400 markers that are being displayed on google maps version 3. The problem is that there are too many markers on the map and that is not a good visual representation. What is want to do is group that the markers (i.e. cluster them). I'm experiencing some issues regarding that. Below is my sample code. function initialize() { var markers = JSON.parse('<%=ConvertDataTabletoString() %>'); var mapOptions = { center: new google.maps.LatLng(markers[0].lat, markers[0].lng), zoom: 2,

Array.prototype.map() method add infowindow

╄→гoц情女王★ 提交于 2019-12-13 08:24:26
问题 I have followed the tutorial to create a cluster google map, but i can not get the info window to work? I can get it to work otherwise... just not with the Array.prototype.map() method... any help? var locations = [] var data var markerData $('.map').each(function (get){ //gather data from html and store data = $(this).data(); markerData = ([data.txt, data.lat, data.lng]) locations.push(markerData); }); function initMap() { var infowindow = new google.maps.InfoWindow(); /* SINGLE */ var map =

Adding Custom Markers (HTMLMarkers) to Clustering

故事扮演 提交于 2019-12-13 08:24:12
问题 I have a working codepen demo of Google Maps Clustering. I'm trying to add in custom html element markers so I can have dynamic text like so: However, when I add in my custom html element marker script (which works by itself) to my marker cluster script - it breaks. Here's my script. If you comment in the broken section (lines 69 - 89) - it stops working. // WORKING function initMap() { var map = new google.maps.Map(document.getElementById("map"), { zoom: 12, center: { lat: 37.773972, lng:

why are my google maps event listeners not working properly?

时光毁灭记忆、已成空白 提交于 2019-12-13 00:56:44
问题 I'm trying to handle mouse over listener for each marker(there are 30 markers) and to show infowindows for these markers. I created listeners for each markers but when my mouse over the some marker it shows always the last marker's infowindows. To sum up I can't listen other markers. any help would be appreciated. thanks in advance and here my code : var listeners = []; for(var i = 0; i < markers.length; i++){ var marker = markers[i]; var contentString = contents[i]; listeners[i] = new google

Animate cluster of markerclusterer

拈花ヽ惹草 提交于 2019-12-12 08:03:05
问题 I am using Google Maps v3 with MarkerClustererPlus. Click for docs I want to animate a cluster if a cluster contains a specific marker. The animation is quite easy if the marker is not inside a cluster. marker.setAnimation(google.maps.Animation.BOUNCE); But i want to bounce the whole cluster-icon. I can get the cluster with: markerCluster.getClusters(); But how can i associate the cluster-div with my getClusters()-Array? I dont know which div belongs to which cluster from the getClusters()

Google Maps API Marker Clusterer and Ajax

谁说胖子不能爱 提交于 2019-12-12 01:49:53
问题 I am running multiple ajax calls to download a large number of google maps icons. When I try to increment the Marker Clusterer, however, the map clears all markers. I believe this is because I am calling var markerCluster = new MarkerCluster(map); in each AJAX call. Can anyone tell me how to correctly implement this? var populateMapByIncident = function(incident, page) { var run_again = false; $.getJSON( "/public_map_ajax_handler", {"shortname" : incident, "page": page}, function(sites_list)

Google Map Clusterer

馋奶兔 提交于 2019-12-12 01:24:17
问题 I've got the Cluster Marker working successfully on some markers, however, it seems that if the area is too congested the cluster won't appear. I'm using the Javascript API. this.map = new google.maps.Map(map, mapOptions); this.markers = data.map((location) => { if (location.location === null) return const marker = new google.maps.Marker({ position: { lat: location.location.coordinates[0], lng: location.location.coordinates[1]}, map: this.map }); return marker }); const markerCluster = new