Why not ask your question on the new OpenStreetMap Community Forum?

hi i use web map and i need to show current location like https://www.openstreetmap.org/ blue svg icon can help me ? thanks.

my script:

    var map = L.map('map').fitWorld();
    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=token', {
        maxZoom: 18,

        id: 'mapbox.streets'

    function onLocationFound(e) {
        var radius = e.accuracy / 2;

        L.marker(e.latlng).addTo(map);              ;
        map.setZoom( 18 );
        L.circle(e.latlng, radius).addTo(map);

    function onLocationError(e) {

    map.on('locationfound', onLocationFound);
    map.on('locationerror', onLocationError);

    map.locate({setView: true, maxZoom: 16});


asked 07 Dec '19, 13:15

eurus's gravatar image

accept rate: 0%

edited 08 Dec '19, 06:50

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 07 Dec '19, 13:15

question was seen: 1,629 times

last updated: 08 Dec '19, 06:50

powered by OSQA