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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!