Skip to content Skip to sidebar Skip to footer

Add A Popup When Clicked Through To A 'plugin' Pulsing Marker In R Leaflet

I managed (with the help of SO) to put a pulsing marker from a plugin to a map with the R leaflet package with the following script : library(leaflet) library(htmltools) library(ht

Solution 1:

Ok, I found something. By doing this, it works!!!

  onRender("function(el,x) {
var pulsingIcon = L.icon.pulse({iconSize:[20,20],color:'red',heartbeat:0.5});
var pulsingIcon2 = L.icon.pulse({iconSize:[10,10],color:'orange',heartbeat:2});
           var marker = L.marker([37.78,-122.41],{icon: pulsingIcon}).bindPopup('<b>Hello world!</b><br>I am a popup.').openPopup().addTo(this);
           var marker = L.marker([37.75,-122.39],{icon: pulsingIcon2}).addTo(this);
           }")

Solution 2:

Try this Demo:

https://jsfiddle.net/xbv5egyz/29/

[![enter image description here][1]][1]

https://i.stack.imgur.com/w5mrO.png

Post a Comment for "Add A Popup When Clicked Through To A 'plugin' Pulsing Marker In R Leaflet"