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,7 +15,7 @@ function createModel(){
//MAP Part //MAP Part
dialogEditNodeMap.setView(internal.config.editmap.view,internal.config.editmap.zoom) dialogEditNodeMap.setView(internal.config.editmap.view,internal.config.editmap.zoom)
L.tileLayer(internal.config.editmap.tiles.url,internal.config.editmap.tiles.option).addTo(dialogEditNodeMap) 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,{ L.geoJson(data,{
pointToLayer: function (feature, latlng){ pointToLayer: function (feature, latlng){
feature.properties.radius = 10 feature.properties.radius = 10
@ -25,12 +25,15 @@ function createModel(){
layer.bindLabel(feature.properties.name) layer.bindLabel(feature.properties.name)
}, },
style: function(feature){ style: function(feature){
if(feature.geometry.type=='LineString') if(feature.geometry.type === "LineString" || feature.geometry.type === "Polygon")
return {color:feature.properties["stroke"], return {color: feature.properties.stroke,
opacity:feature.properties["stroke-opacity"],
fillColor: feature.properties.fill,
fillOpacity:feature.properties["fill-opacity"],
stroke: true, stroke: true,
weight: 5, weight: feature.properties["stroke-width"],
lineCap:'round', lineCap: "round",
lineJoin:'round'} lineJoin: "round"}
return { return {
color: feature.properties["marker-color"], color: feature.properties["marker-color"],
fillColor: feature.properties["marker-color"], fillColor: feature.properties["marker-color"],