angular-leaflet-directive
angular-leaflet-directive copied to clipboard
Is it possible to GEOJSON open popup by GET param in the url?
I need to open a popup on geoJSON feature by GET. I cant find how is this possible here is my geojson layer setup code:
angular.extend($scope.layers.overlays, {
sold: {
name: 'Sold Land',
type: 'geoJSONShape',
data: data,
visible: true,
layerOptions: {
style: {
color: '#ff0000',
weight: 1,
fillOpacity: 0,
opacity: 1,
},
onEachFeature:
function (feature, layer) {
layer.on('click', function (e) {
$http.get("/ajax.php?landId=" + feature.properties.id).success(function (data, status) { //var landData =
var landDiv = document.getElementById('sold-detail-' + feature.properties.id);
landDiv.innerHTML = data;
return data;
});
});
const popup = L.responsivePopup({className: 'buyPopup'}).setContent('<div class="buyPopup" id="sold-detail-' + feature.properties.id + '">Loading...</div>');
layer.bindPopup(popup);
},
},
},
selectedLand: {},
});
// Put the cells on an associative array
$scope.cells = {};
for (var i = 0; i < data.length; i++) {
var cell = data[i];
$scope.cells[cell['properties']['type']] = cell;
}
});```