leafletangular-leaflet-directive

How do you change the offset for a leaflet popup using angular leaflet directive and geojson?


I'm using the angular-leaflet-directive and geojson to create map markers using leaflet and mapbox. The popups on the markers aren't correctly aligned on the marker.

offset problem

angular.extend($scope, { // Map data
                geojson: {
                    data: $scope.filteredShows,
                    onEachFeature: function (feature, layer) {
                        layer.bindPopup(feature.properties.artist + ' · ' + feature.properties.venue);
                        layer.setIcon(defaultMarker);
                        layer.on({
                            mouseover: pointMouseover,
                            mouseout: pointMouseout
                        });
                        layers[feature.properties.id] = layer;
                    }
                }

            });

How do I change the offset on the markers?


Solution

  • Using popupAnchor: [-10, -10], in L.Icon. See http://leafletjs.com/reference.html#icon