Skip to content

Is possible to have open popup witk marker ? #1670

Answered by ambarja
ambarja asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks, but the answer was the following:

// Basic basemap
var map = new maplibregl.Map({
    container: 'map',
    style:
    'https://api.maptiler.com/maps/outdoor/style.json?key=hdV4nOYKQa4di4tH4qr2	',
    center: [-71.04286,-13.85728],
    zoom: 10
    }).addControl(new maplibregl.NavigationControl(), 'top-right');

// New Popup
var popup = new maplibregl.Popup({offset: 25,closeOnClick: false})
  .setHTML('<b> Hi everyone! My name is Antony :3 and I am a Geographer in internet </b>')
  .setLngLat([-71.04286,-13.85728])
  .addTo(map);
  
// create DOM element for the marker
var el = document.createElement('div');
el.id = 'marker';
var maker = new maplibregl.Marker(el)
    .setLngLat([-7…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@ambarja
Comment options

@wipfli
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ambarja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants