update geojson editmap

This commit is contained in:
Martin Geno 2016-06-24 11:20:15 +02:00
parent 5b46e9a6c9
commit 136e14252f
1 changed files with 24 additions and 21 deletions

View File

@ -15,30 +15,33 @@ function createModel(){
//MAP Part
dialogEditNodeMap.setView(internal.config.editmap.view,internal.config.editmap.zoom)
L.tileLayer(internal.config.editmap.tiles.url,internal.config.editmap.tiles.option).addTo(dialogEditNodeMap)
send('GET',internal.config.editmap.geojson).then(function(data){
send("GET",internal.config.editmap.geojson).then(function(data){
L.geoJson(data,{
pointToLayer: function (feature, latlng){
feature.properties.radius = 10
return L.circleMarker(latlng,feature.properties)
},
onEachFeature:function(feature, layer) {
layer.bindLabel(feature.properties.name)
},
style:function(feature){
if(feature.geometry.type=='LineString')
return {color:feature.properties["stroke"],
stroke:true,
weight: 5,
lineCap:'round',
lineJoin:'round'}
return {
color:feature.properties["marker-color"],
fillColor:feature.properties["marker-color"],
fillOpacity: 0.2,
weight: 2,
stroke: true
}
feature.properties.radius = 10
return L.circleMarker(latlng, feature.properties)
},
onEachFeature: function(feature, layer) {
layer.bindLabel(feature.properties.name)
},
style: function(feature){
if(feature.geometry.type === "LineString" || feature.geometry.type === "Polygon")
return {color: feature.properties.stroke,
opacity:feature.properties["stroke-opacity"],
fillColor: feature.properties.fill,
fillOpacity:feature.properties["fill-opacity"],
stroke: true,
weight: feature.properties["stroke-width"],
lineCap: "round",
lineJoin: "round"}
return {
color: feature.properties["marker-color"],
fillColor: feature.properties["marker-color"],
fillOpacity: 0.2,
weight: 2,
stroke: true
}
}
}).addTo(dialogEditNodeMap)
})
dialogEditNodeMapCurrent = L.marker(internal.config.editmap.view,{