Search Posts

Category: leaflet

Leaflet using inline svg as the base layer

Currently, I serve a map with an imageOverlay base layer. Right now, I need to use an svg instead of the current png imageOverlay, and to alter the svg css (like, changing opacity for the nearest places (paths in the svg) etc), dynamically, so basically, I need to control the actual map svg style dynamically. I’ve decided I need to use an inline svg to alter the style of the svg, instead of an image […]

Using $compile on a html string only returns first line

I’m working on a leaflet map that contains markers. I’m using angular.js. I want to bind a popup to each marker which contain information about the marker. If you click on the marker name it should call a function. This is my .js : var boreholePopup = (‘<a ng-click=”boreholeMarkerClicked(‘ + $scope.boreholes[i] + ‘)”>’ + $scope.boreholes[i].boreholeName + “</a><br>Elevation: ” + $scope.boreholes[i].boreholeName + “m<br>Type: ” + $scope.boreholes[i].boreholeName); var compiled = $compile(boreholePopup)($scope); console.log(‘compiled’, compiled); boreholeMarker .bindPopup(compiled[0]) .on(‘mouseover’, function(e) […]