3
votes
Pie charts in R leaflet, turn count into sum and control more the size
I would like the code to sum values from each data point and not count.
You can pass your data/stats to markers using markerOptions()
leaflet() %>%
addTiles() %>%
addMarkers(
...
2
votes
Accepted
Making selectizeInput reactive to show/hide markers on Leaflet Shiny R
Try this
library(leaflet)
library(shiny)
library(shinydashboard)
library(dplyr)
#Data Sample
long <- c(-96.72363, -96.72880, -96.72700)
lat <- c(17.06167, 17.06200, 17.06170 )
name <- c(&...
2
votes
Accepted
Leaflet Marker Cluster coverage path options
I guess you are using the Leaflet.markercluster plugin, and are asking how to customize the coverage polygon that is displayed when hovering a cluster, or how to disable this feature?
In that case:
...
2
votes
Accepted
Custom icons for MarkerClusters in React Leaflet
Complete example update - working example is on codesanbox
import React from "react";
import { MapContainer, TileLayer, Marker } from "react-leaflet";
import MarkerClusterGroup ...
2
votes
Accepted
Set custom marker image as center instead of bottom in Leaflet
Change iconAnchor: [25, 50], (the bottom) to iconAnchor: [25, 25], (the center)
var icon = window.L.icon({
iconUrl: "MYICON_SVG_IMAGE",
iconSize: [50, ...
1
vote
Accepted
Custom Leaflet icons not showing up when generated in a loop
The issue was that I was not creating a new L.marker() for each new marker. This code fixed the issue:
// the data object is passed after successful ajax call
let markers = L.markerClusterGroup({
...
1
vote
react-leaflet-markercluster is not working
@akhtem-aliiev Maybe try this? https://www.npmjs.com/package/@changey/react-leaflet-markercluster . This link addresses the react 18 and leaflet v4 compatibility issue. I was able to get it to work. ...
1
vote
How can I get Leaflet markerClusters to work with reading data from CSV with PapaParse?
marker.addTo(map);
was the issue. I followed the example provided by Dom in the comments here: stackoverflow.com/a/66616249/10684798
and updated the code (with simplified variables) to:
var markers = ...
1
vote
Accepted
Leaflet 1.7: L.MarkerClusterGroup is not a function
Depending on your build engine, the imported L namespace from "leaflet" may not be augmented with MarkerClusterGroup (from leaflet.markercluster plugin) unfortunately.
But you can resort to ...
1
vote
leaflet.js:5 Uncaught TypeError: Cannot read properties of undefined (reading 'trim')
You are useing twice () in marker creation.
Change:
let marker = L.marker(([data[i].latitude, data[i].longitude]));
to:
let marker = L.marker([data[i].latitude, data[i].longitude]);
1
vote
Accepted
MarkerCluster markers are still showing behind cluster
You are adding the created marker to the map too and this is wrong (icon: carIcon }).addTo(mymap).bindPopup().
Change
markers.addLayer(carMarker = L.marker([currentLatitude, currentLongitude], { icon:...
1
vote
Clusters not appearing in leaflet from Marker Cluster and FeatureGroup.SubGroup
I have now got it working by using MarkerCluster.LayerSupport and by adding it to both var map and checking it in - maybe wrong plugin usage but likely my human error.
Working code below:
var map = L....
1
vote
Accepted
Cluster geojson Layer doesn't work with marker filtering
Once you have populated your Leaflet GeoJSON Layer Group (typically with geojsonLayer.addData(geoJsonObject), then instead of adding that group to your map, simply add it into your MarkerClusterGroup:
...
1
vote
Accepted
Assigning ID to marker and adding and removing from cluster using leaf.js
Leaflet markers are classes, so one thing you can try is to add a property to the class and find the marker by that property. For instance, if you have a marker and the data for the marker contains a ...
1
vote
How to change the options of React MarkerClusterGroup when MarkerClusterGroup is a parent element?
According to the new API version on 1.1.8, something like this will work:
<MarkerClusterGroup showCoverageOnHover={false} >
<MarkersLayer
stationsToDisplay={stationsToDisplay}
...
1
vote
useLeafletContext() can only be used in a descendant of <MapContainer>
In the 3.2.0 release of react-leaflet, the author of the library started using the nullish coalescing operator which as I understand it breaks various bundlers including create-react-app when the ...
1
vote
Accepted
Hide markers on Leaflet -or- help filtering results from json url
Simply do not create a Leaflet Marker at all when you have an expired data point:
if (javaScriptRelease2 < javaScriptRelease) {
console.log('open house in the future');
// Create a ...
1
vote
Accepted
Adding Capital City Markers to a Leaflet Map Using a JS File
The simplest way to add marker to a Leaflet map would be in the following way:
L.marker([50.84673, 4.35247]).addTo(map);
In your case, since you are trying to add markers on the basis of the ...
1
vote
How can i resolve this MarkerCluster checkin/ checkout error (leaflet salesforce)?
I resolve the issue by adding all the vertices together, I created an array that contains all the vertices and then added them using the function addLayers
const folders = 800;
for (let index = 0; ...
1
vote
Does markercluster work together with leafletProxy() and option iconCreateFunction?
For anyone else who is struggling with this, the bug has been recently solved:
https://github.com/rstudio/leaflet/pull/696
You need to reinstall leaflet from github using:
remotes::install_github(&...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
leaflet.markercluster × 308leaflet × 283
javascript × 154
react-leaflet × 23
reactjs × 19
r × 17
angular × 16
markerclusterer × 14
angular-leaflet-directive × 12
html × 11
typescript × 9
ajax × 8
vue.js × 8
css × 7
openstreetmap × 7
jquery × 6
shiny × 6
maps × 6
geojson × 6
popup × 5
mapbox × 5
r-leaflet × 5
angularjs × 4
marker × 4
markers × 4