update geojson editmap
This commit is contained in:
parent
5b46e9a6c9
commit
136e14252f
|
@ -15,25 +15,28 @@ 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
|
||||||
return L.circleMarker(latlng,feature.properties)
|
return L.circleMarker(latlng, feature.properties)
|
||||||
},
|
},
|
||||||
onEachFeature:function(feature, layer) {
|
onEachFeature: function(feature, layer) {
|
||||||
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,
|
||||||
stroke:true,
|
opacity:feature.properties["stroke-opacity"],
|
||||||
weight: 5,
|
fillColor: feature.properties.fill,
|
||||||
lineCap:'round',
|
fillOpacity:feature.properties["fill-opacity"],
|
||||||
lineJoin:'round'}
|
stroke: true,
|
||||||
|
weight: feature.properties["stroke-width"],
|
||||||
|
lineCap: "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"],
|
||||||
fillOpacity: 0.2,
|
fillOpacity: 0.2,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
stroke: true
|
stroke: true
|
||||||
|
|
Loading…
Reference in New Issue