我有名为json_point2的GeoJSON文件。 该文件保存点数据如下。
var json_point2={
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "Class": null }, "geometry": { "type": "Point", "coordinates": [ 40.193168611061743, 40.904508523555492 ] } },
{ "type": "Feature", "properties": { "Class": null }, "geometry": { "type": "Point", "coordinates": [ 40.191358449981372, 40.902051540140285 ] } },
当我在我的网络应用上点击此点时,我想输入类的输入值并再次保存该值。
我可以使用以下代码单击该点并输入该属性。但是他并没有将它记录在他的数据库中。
mycode的
map.createPane('pane_point2');
map.getPane('pane_point2').style.zIndex = 602;
map.getPane('pane_point2').style['mix-blend-mode'] = 'normal';
var layer_point2 = new L.geoJson(json_point2, {
attribution: '<a href=""></a>',
pane: 'pane_point2',
onEachFeature: function (feature, layer) {
var input = L.DomUtil.create('input', 'my-input');
input.value = feature.properties.Class;
L.DomEvent.addListener(input, 'change', function () {
feature.properties.Class = input.value;
});
layer.bindPopup(input);
layer_point2.toGeoJSON();
}
}).addTo(map);