Question
I'm using 'leaflet.js' placing popup markers on a map and also using geolocation to get the users current location on the map. A blue default
I'm using 'leaflet.js' placing popup markers on a map and also using geolocation to get the users current location on the map.
A blue default popup is set for each marker I set. //eg,engineering building
var engBuilding = L.marker([43.283793,-14.5334348]).bindPopup('Engineering Building');
Is there any way I can use CSS to change the popup marker color to red for the geolocation marker??
Here is my geolocation code:
//geolcation marker function onLocationFound(e) { var radius = e.accuracy / 2; L.marker(e.latlng).addTo(map) .bindPopup("You are currently here").openPopup(); L.circle(e.latlng, radius).addTo(map); } function onLocationError(e) { alert(e.message); } map.on('locationfound', onLocationFound); map.on('locationerror', onLocationError); map.locate({setView: true, maxZoom: 16}); var newMarker = new L.marker(e.latlng).addTo(map);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started