leaflet.markercluster

Leaflet Markercluster: Exempt marker from clustering

試著忘記壹切 提交于 2020-01-05 03:18:10
问题 How can one exampt a marker with open popup from collapsing into a cluster when zooming out? I am using leaflet and markercluster as set up in this example: HTML: <div id="map"></div> CSS: html, body { height: 100%; } #map { height: 100%; } JS: const map = L.map('map', { zoom: 5, center: [0,0], maxZoom: 18 }); const clustered = L.markerClusterGroup(); map.addLayer(clustered); const m1 = L.marker(L.latLng(0,0)); m1.addTo(clustered); m1.bindPopup('one'); const m2 = L.marker(L.latLng(0,1)); m2

Using several Marker Cluster Groups displays overlapping Clusters

点点圈 提交于 2019-12-31 05:29:53
问题 I am using several L.markerClusterGroup({}) 's so that I can switch them in a Layers Control. But the Clusters hide behind each other. I would like to be able to get the total number of both Clusters. What am I missing? 回答1: The issue is that each Leaflet Marker Cluster Group (i.e. L.markerClusterGroup ) will perform its own clustering and render Clusters irrespective of what other Cluster Groups may display. Therefore if you have some individual Markers (or any point Features) that are in

Cluster multiple Layers with markercluster

a 夏天 提交于 2019-12-30 19:59:46
问题 I am currently working on a map visualization with the Leaflet library. I am also using the markercluster plugin to cluster my points. So my question now is the following: I have 3 different categories of Markers in 3 different layers. For example Restaurants, Cafes and Bars Layers. And I want to combine all active Layers to a specific cluster. At the moment the entries are clustered separately but I want to cluster them together. The next step would be coloring the cluster according to the

How to update popup content using MarkerCluster with leaflet

主宰稳场 提交于 2019-12-24 08:47:15
问题 I'm trying to show a map with lot of markers on it (~36.000) that have to contains some informations. First, I SELECT elements from a database, then I encode it in JSON array with PHP, then I get it with JSS and finally I add it to my map, and set the content of the popup with the data in the JSON array. The problem is that there are so much data that PHP throws Fatal error: Allowed memory size of 134217728 bytes exhausted . What I think I can do to overpass this is to make a SQL request for

Does markercluster work together with leafletProxy() and option iconCreateFunction?

≡放荡痞女 提交于 2019-12-21 17:38:23
问题 Am I doing something wrong, or why does the below example not work? I am trying to make leaflet markercluster plugin work with leafletProxy() in an R Shiny app, using the option iconCreateFunction . Is the plugin not capable of adding customized icon markers to the map using leafletProxy() ? When I press the first button and zoom out in below example, I get an error saying: TypeError: this._group.options.iconCreateFunction is not a function I tried to copy the original example from the

R - Leaflet Limitations - How many markers does a leaflet map support?

故事扮演 提交于 2019-12-20 06:18:02
问题 Data I have a dataframe which contains 35,000 lat/lon locations. The locations have been plotted onto an interactive leaflet map. The Situation I would like to publish the map online via a markdown document. The Problem When I export the map as an html page or in markdown the map is: Laggy Hard to navigate Webpage Loads slowly Questions What is the maximum number of points you plot on a leaflet map without compromising the ability to navigate the map? Would publishing the map as a shiny

How to make MarkerClusterGroup cluster polygons

痴心易碎 提交于 2019-12-14 03:54:59
问题 I am trying to show clusters using markerclustergroups with Polygons. Right now the polygons are shown but the clusters aren't. I have been trying to use center of mass for the polygons because it seems like markerclustergroup doesn't like polygons but that doesn't really work since the animation of markerclustergroup will be set on the centroids and not the actual polygon. My polygons all vary in amount of coordinates. Some have +10 sets others have 3. How would I use markerclustergroup for

Markercluster spiderfy - Map max zoom level displays the marker icon groups instead of cluster view with count

两盒软妹~` 提交于 2019-12-13 18:14:28
问题 When executing the code, we can see the cluster view with count 3. After clicking on the cluster, It zooms into the max zoom level and displays the cluster view with count 3. In this max zoom level, I wanted to display the marker icon groups instead of the cluster view with count 3. After click on the marker icon groups, It should spiderfy. <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" /> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare

Search for markers in a markercluster group Leaflet-MarkerCluster

南楼画角 提交于 2019-12-13 15:46:35
问题 I am using Leaflet.markercluster to cluster my markers in my Mapbox Map. The markers are to be populated using a json file. All I need is a search feature which can popup the requisite marker based on search string. I got to know about Leaflet-search, but am unable to integrate it with my code. How should I go about this? 回答1: Simply iterate through your layer group (like your Marker Cluster Group), e.g. using eachLayer(fn), test against the marker attributes, and if you find your target

Popup on hovering over cluster group

浪尽此生 提交于 2019-12-13 00:55:18
问题 I want to add popup on cluster group made using Leaflet.markercluster just like the popups that come on hovering over the leaflet markers. 回答1: I was able to find the answer with the help of issues present in the github page of leaflet.markercluster cluster.on('clustermouseover', function(c) { var popup = L.popup() .setLatLng(c.layer.getLatLng()) .setContent(c.layer._childCount +' Locations(click to Zoom)') .openOn(map); }).on('clustermouseout',function(c){ map.closePopup(); }).on(