map = {
let container = DOM.element('div', { style: `width:${width}px;height:${width/1.6}px` });
yield container;
let map = L.map(container).setView([43.577, 1.402], 17);
let osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);
let crs = L.CRS.EPSG4326;
let wfstPointOptions = {
crs: crs,
showExisting: true,
geometryField: 'geom',
url: 'https://www.geotests.net/geoserver/wms',
typeNS: 'ljegou',
typeName: 'test_points',
maxFeatures: 10,
opacity: 1,
style: function(layer) {
return {
color: 'yellow',
fillColor: '#f00',
fillOpacity: 0.8,
weight: 2
}
},
};
let wfstPoint = new L.WFST(wfstPointOptions, new L.Format.GeoJSON({
crs: crs,
pointToLayer(geoJsonPoint, latlng) {
const layer = new L.CircleMarker(latlng, {
radius: 10,
});
layer.bindPopup("Point : "+geoJsonPoint.properties.nom);
return layer;
},
})).addTo(map);
let tm = L.geoJSON(tlsemetro).addTo(map);
}