node-red-contrib-geofence
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "node-red-contrib-geofence", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A simple node to filter based on location", | ||
@@ -5,0 +5,0 @@ "dependencies" :{ |
@@ -32,3 +32,11 @@ var configButton; | ||
node = this; | ||
var fenceEditOptions; | ||
var ownFenceStyle = { | ||
color: '#ffffff', | ||
fillColor: '#42f4d7' | ||
}; | ||
var otherFenceStyle = { | ||
color: '#808080', | ||
fillColor: '#808080' | ||
}; | ||
function initializeMap(node) { | ||
@@ -41,5 +49,17 @@ map = L.map('node-geofence-map').setView([57.696, 11.9788], 9); | ||
fenceEditOptions = { | ||
showLength: true, | ||
icon: new L.DivIcon({ | ||
iconSize: new L.Point(8, 8), | ||
className: 'leaflet-div-icon leaflet-editing-icon test' | ||
}), | ||
touchIcon: new L.DivIcon({ | ||
iconSize: new L.Point(15, 15), | ||
className: 'leaflet-div-icon leaflet-editing-icon leaflet-touch-icon test' | ||
}) | ||
}; | ||
window.node_geofence_map = map; | ||
L.tileLayer(osmUrl, { | ||
maxZoom: 18, | ||
maxZoom: 25, | ||
attribution: osmAttrib | ||
@@ -59,2 +79,3 @@ }).addTo(map); | ||
drawControl = new L.Control.Draw({ | ||
@@ -68,5 +89,12 @@ draw: { | ||
polygon: { | ||
showLength: true | ||
showLength: true, | ||
icon: new L.DivIcon({ | ||
iconSize: new L.Point(8, 8), | ||
className: 'leaflet-div-icon leaflet-editing-icon test' | ||
}), | ||
touchIcon: new L.DivIcon({ | ||
iconSize: new L.Point(15, 15), | ||
className: 'leaflet-div-icon leaflet-editing-icon leaflet-touch-icon test' | ||
}) | ||
} | ||
} | ||
@@ -81,3 +109,8 @@ }); | ||
"google": L.tileLayer('http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', { | ||
attribution: 'google' | ||
attribution: 'google', | ||
maxZoom: 25 | ||
}), | ||
'custom': L.tileLayer('https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFnbnVzc3AiLCJhIjoiY2lnM3AyeTlrMDJrcXYza2hwYXF1cWtidCJ9.wuim_DRupGAUe6gbLSY-jA', { | ||
attribution: 'MagnusMaps (c)', | ||
maxZoom: 25 | ||
}) | ||
@@ -101,4 +134,3 @@ }, { 'drawlayer': drawnItems }, { collapsed: true }).addTo(map); | ||
fence.setStyle({color: '#ffffff'}); | ||
fence.setStyle({fillColor: '#42f4d7'}); | ||
fence.setStyle(ownFenceStyle); | ||
@@ -163,2 +195,3 @@ map.fitBounds( | ||
var fence = L.GeoJSON.geometryToLayer(nodeManager.geofences[nodeID]); | ||
fence.editing.options = fenceEditOptions; | ||
fence.nodeID = nodeID; | ||
@@ -170,7 +203,5 @@ | ||
if (myFence == true) { | ||
fence.setStyle({color: '#ffffff'}); | ||
fence.setStyle({fillColor: '#42f4d7'}); | ||
fence.setStyle(ownFenceStyle); | ||
} else { | ||
fence.setStyle({color: '#808080'}); | ||
fence.setStyle({fillColor: '#808080'}); | ||
fence.setStyle(otherFenceStyle); | ||
} | ||
@@ -177,0 +208,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4756194
44766