question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I want to modified the offset of a CircleMarker’s popup (I use geojson datas)

var geojsonLayer = new L.GeoJSON(null, {
    pointToLayer: function (latlng){
        return new L.CircleMarker(latlng, {
            radius: 8,
            fillColor: "#ff7800",
            color: "#000",
            weight: 1,
            opacity: 1,
            fillOpacity: 0.8
        });
    }
});
geojsonLayer.on("featureparse", function (e) {
    var popupContent = e.properties.popupContent;
    e.layer.bindPopup(popupContent);
});
map.addLayer(geojsonLayer);

I didn’t find where to add the offset : I tried in bindPopup (after popupContent) but it’s not working.

e.layer.bindPopup(popupContent,(10,10));

Someone can help me?

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
mournercommented, Jun 18, 2012

Try this:

e.layer.bindPopup(popupContent, {offset: new L.Point(10, 10)})
0reactions
lentyaishecommented, Jun 6, 2017

@mourner You just saved my day!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Popups offset from points Mapbox GL JS - GIS Stack Exchange
I've been playing a lot with mapbox for mapping some data of mine. I have created a map that is heavily borrowed from...
Read more >
Shortbed Offset Couplers - Pop Up Hitch
SB1 9" offset gooseneck coupler, or extended coupler gives you more ... The folks at PopUp Towing were great to deal with and...
Read more >
Attach a popup to a marker instance | Mapbox GL JS
const popup = new mapboxgl.Popup({ offset: 25 }).setText(. 'Construction on the Washington Monument began in 1848.' );. // create DOM element for the...
Read more >
Popup.HorizontalOffset Property (System.Windows.Controls ...
The following example creates a Popup and sets the HorizontalOffset and VerticalOffset properties to 20. The Placement property is set to Bottom (which...
Read more >
Popup and Offset problems - Google Groups
I've got my maps working, now dealing with more visual issues. One thing I'm trying to tweak is the location of popups. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found