Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-geofence

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-geofence - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

6

geofence.js

@@ -66,3 +66,9 @@ /**

RED.comms.publish(node.id + "/locationUpdate", loc);
if(fence == null){
node.warn("No geofence defined");
return;
}
var points = [];

@@ -69,0 +75,0 @@ var fenceCoordinates = fence.geometry.coordinates[0];

2

package.json
{
"name": "node-red-contrib-geofence",
"version": "0.1.0",
"version": "0.2.0",
"description": "A simple node to filter based on location",

@@ -5,0 +5,0 @@ "dependencies" :{

@@ -36,6 +36,10 @@ var configButton;

var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
var osm = L.tileLayer(osmUrl, { maxZoom: 18, attribution: osmAttrib });
window.node_geofence_map = map;
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 20,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
L.tileLayer(osmUrl, {
maxZoom: 18,
attribution: osmAttrib
}).addTo(map);

@@ -65,2 +69,11 @@

L.control.layers(
{
'osm': osm.addTo(map),
"google": L.tileLayer('http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', {
attribution: 'google'
})
}, { 'drawlayer': drawnItems }, { collapsed: true }).addTo(map);
var editControl = new L.Control.Draw({

@@ -129,2 +142,13 @@ draw: false,

var marker;
RED.comms.subscribe(node.id + "/locationUpdate", function(topic, location) {
var location = new L.LatLng(location.latitude, location.longitude)
if(marker == null){
marker = L.marker(location);
marker.addTo(map);
}
marker.setLatLng(location)
});
Object.keys(nodeManager.geofences).map(function (nodeID, index) {

@@ -131,0 +155,0 @@ var fence = L.GeoJSON.geometryToLayer(nodeManager.geofences[nodeID]);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc