Currently, I am using leaflet in conjunction with Angular and have a query regarding making a button clickable within a message popup. Although I understand that I need to compile the HTML, I am struggling to implement it successfully as there are no examples available featuring a JSON request.
Any suggestions or tips would be greatly appreciated!
$http.get(searchterm).then(function(articlesResponse) {
$scope.geonamesorte = articlesResponse.data;
var meineMarker = {};
for (var i = 0; i < $scope.geonamesorte.length; i++) {
var ortObjektausListe = $scope.geonamesorte[i];
var myobjectname = ortObjektausListe.name.replace(/[^a-zA-Z0-9]/g,'_');
ortlat = parseFloat(ortObjektausListe.lat);
ortlng = parseFloat(ortObjektausListe.lng);
meineMarker[myobjectname+i] = {
lat: ortlat,
lng: ortlng,
message: "<span><a href='' ng-click='dosomething()''>info</a></span>",
focus: false,
draggable: false
};
}
// Displaying markers on the map
angular.extend($scope, {
markers: meineMarker,
defaults:{
tileLayer:"http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png"
}
});
});