New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esri-leaflet-heatmap-feature-layer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esri-leaflet-heatmap-feature-layer - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0-beta.1

CHANGELOG.md

2

bower.json
{
"name": "esri-leaflet-heatmap-feature-layer",
"version": "v1.0.2",
"version": "v2.0.0-beta.1",
"main": "dist/esri-leaflet-heatmap-feature-layer.js",

@@ -5,0 +5,0 @@ "ignore": [

@@ -1,6 +0,5 @@

/*! esri-leaflet-heatmap-feature-layer - v1.0.2 - 2015-07-11
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
!function(a){if("function"==typeof define&&define.amd?define(["leaflet","esri-leaflet"],function(L,b){return a(L,b)}):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=a(require("leaflet"),require("esri-leaflet"))),window&&window.L&&window.L.esri){var b=a(L,L.esri);window.L.esri.Layers.HeatmapFeatureLayer=b,window.L.esri.HeatmapFeatureLayer=b,window.L.esri.Layers.heatmapFeatureLayer=function(a){return new b(a)},window.L.esri.heatmapFeatureLayer=function(a){return new b(a)}}}(function(L,a){var b=a.Layers.FeatureManager.extend({initialize:function(b){a.Layers.FeatureManager.prototype.initialize.call(this,b),b=L.setOptions(this,b),this._cache={},this._active={},this.heat=new window.L.heatLayer([],b)},onAdd:function(b){a.Layers.FeatureManager.prototype.onAdd.call(this,b),this._map.addLayer(this.heat)},onRemove:function(b){a.Layers.FeatureManager.prototype.onRemove.call(this,b),this._map.removeLayer(this.heat)},createLayers:function(a){for(var b=a.length-1;b>=0;b--){var c=a[b],d=c.id,e=new L.LatLng(c.geometry.coordinates[1],c.geometry.coordinates[0]);this._cache[d]=e,!this._active[d]&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(c))&&(this._active[d]=e,this.heat._latlngs.push(e))}this.heat.redraw()},addLayers:function(a){for(var b=a.length-1;b>=0;b--){var c=a[b];if(!this._active[c]){var d=this._cache[c];this.heat._latlngs.push(d),this._active[c]=d}}this.heat.redraw()},removeLayers:function(a,b){for(var c=[],d=a.length-1;d>=0;d--){var e=a[d];this._active[e]&&delete this._active[e],this._cache[e]&&b&&delete this._cache[e]}for(var f in this._active)c.push(this._active[f]);this.heat.setLatLngs(c)}});return b});
//# sourceMappingURL=esri-leaflet-heatmap-feature-layer.js.map
/* esri-leaflet-heatmap-feature-layer - v2.0.0-beta.1 - Fri Aug 07 2015 11:37:44 GMT-0700 (PDT)
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache 2.0 */
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],factory):factory(global.L.esri.Heat={},L,L.esri)})(this,function(exports,L,esri_leaflet){"use strict";exports.VERSION="2.0.0-beta.1";exports.HeatmapFeatureLayer=esri_leaflet.FeatureManager.extend({initialize:function(options){esri_leaflet.FeatureManager.prototype.initialize.call(this,options);options=L.setOptions(this,options);this._cache={};this._active={};this.heat=window.L.heatLayer([],options)},onAdd:function(map){esri_leaflet.FeatureManager.prototype.onAdd.call(this,map);this._map.addLayer(this.heat)},onRemove:function(map){esri_leaflet.FeatureManager.prototype.onRemove.call(this,map);this._map.removeLayer(this.heat)},createLayers:function(features){for(var i=features.length-1;i>=0;i--){var geojson=features[i];var id=geojson.id;var latlng=new L.LatLng(geojson.geometry.coordinates[1],geojson.geometry.coordinates[0]);this._cache[id]=latlng;if(!this._active[id]&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(geojson))){this._active[id]=latlng;this.heat._latlngs.push(latlng)}}this.heat.redraw()},addLayers:function(ids){for(var i=ids.length-1;i>=0;i--){var id=ids[i];if(!this._active[id]){var latlng=this._cache[id];this.heat._latlngs.push(latlng);this._active[id]=latlng}}this.heat.redraw()},removeLayers:function(ids,permanent){var newLatLngs=[];for(var i=ids.length-1;i>=0;i--){var id=ids[i];if(this._active[id]){delete this._active[id]}if(this._cache[id]&&permanent){delete this._cache[id]}}for(var latlng in this._active){newLatLngs.push(this._active[latlng])}this.heat.setLatLngs(newLatLngs)}});function heatmapFeatureLayer(options){return new exports.HeatmapFeatureLayer(options)}var _HeatmapFeatureLayer=heatmapFeatureLayer;exports.heatmapFeatureLayer=heatmapFeatureLayer;exports.default=_HeatmapFeatureLayer});
//# sourceMappingURL=./esri-leaflet-heatmap-feature-layer.js.map

@@ -19,5 +19,5 @@ // Karma configuration

'node_modules/leaflet.heat/dist/leaflet-heat.js',
'node_modules/esri-leaflet/dist/esri-leaflet-src.js',
'node_modules/esri-leaflet/dist/esri-leaflet.js',
'spec/**/*Spec.js',
'src/HeatmapFeatureLayer.js'
'dist/esri-leaflet-heatmap-feature-layer.js'
],

@@ -24,0 +24,0 @@

{
"name": "esri-leaflet-heatmap-feature-layer",
"version": "1.0.2",
"description": "Esri Leaflet plugin for visualizing Feature Layers as heatmaps with L.heat.",
"main": "dist/esri-leaflet-heatmap-feature-layer.js",
"version": "2.0.0-beta.1",
"author": "Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)",
"browserify": {
"transform": [
[
"babelify",
{
"whitelist": [
"es6.modules"
],
"loose": [
"es6.modules"
]
}
]
]
},
"contributors": [
"Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)",
"John Gravois <jgravois@esri.com> (http://johngravois.com)"
],
"dependencies": {
"leaflet": "^1.0.0-beta.1",
"esri-leaflet": "^2.0.0-beta.4",
"leaflet.heat": "^0.1.3"
},
"devDependencies": {
"grunt": "^0.4.2",
"grunt-karma": "^0.8.3",
"grunt-gh-pages": "^0.8.1",
"grunt-releaseable": "0.0.12",
"grunt-contrib-jshint": "^0.4.3",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-contrib-concat": "^0.5.0",
"karma": "^0.12.16",
"karma-coverage": "^0.1",
"karma-chrome-launcher": "^0.1.3",
"karma-safari-launcher": "^0.1.1",
"karma-firefox-launcher": "^0.1.3",
"karma-phantomjs-launcher": "^0.1.4",
"babelify": "^6.1.3",
"chai": "2.3.0",
"gh-release": "^2.0.0",
"isparta": "^3.0.3",
"istanbul": "gotwarlost/istanbul.git#source-map",
"karma": "^0.12.24",
"karma-chai-sinon": "^0.1.3",
"karma-coverage": "douglasduteil/karma-coverage#next",
"karma-mocha": "^0.1.0",
"karma-mocha-reporter": "^0.2.5",
"karma-chai-sinon": "^0.1.3",
"load-grunt-tasks": "^0.4.0"
"karma-phantomjs-launcher": "^0.1.4",
"karma-sourcemap-loader": "^0.3.5",
"mkdirp": "^0.5.1",
"node-sass": "^3.2.0",
"phantomjs": "^1.9.17",
"rollup": "^0.10.0",
"semistandard": "^6.1.2",
"sinon": "^1.11.1",
"sinon-chai": "2.7.0",
"uglify-js": "^2.4.23"
},
"homepage": "https://github.com/Esri/esri-leaflet-heatmap-feature-layer",
"jsnext:main": "src/HeatmapFeatureLayer.js",
"jspm": {
"files": [
"src/*.js",
"dist/*"
],
"registry": "npm",
"format": "es6"
},
"license": "Apache 2.0",
"main": "src/HeatmapFeatureLayer.js",
"scripts": {

@@ -31,13 +69,17 @@ "prepublish": "grunt prepublish",

},
"author": "Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)",
"contributors": [
"Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)"
],
"license": "Apache",
"main": "dist/esri-leaflet-heatmap.js",
"readmeFilename": "README.md",
"dependencies": {
"leaflet": "^0.7.3",
"esri-leaflet": "^1.0.0",
"leaflet.heat": "^0.1.3"
"repository": {
"type": "git",
"url": "git@github.com:Esri/esri-leaflet-heatmap-feature-layer.git"
},
"scripts": {
"prebuild": "mkdirp dist",
"build": "./scripts/build.js",
"lint": "semistandard src/*.js",
"prepublish": "npm run build",
"pretest": "npm run build",
"release": "./scripts/release.sh",
"test": "npm run lint && karma start"
}
}

@@ -5,9 +5,9 @@ # Esri Leaflet Heatmap Feature Layer

A plugin for Esri Leaflet that enables visualization of Feature Services as heatmaps using the [L.heat](https://github.com/Leaflet/Leaflet.heat) Leaflet Plugin.
A plugin for Esri Leaflet that enables visualization of Feature Services as heatmaps built on top of the [L.heat](https://github.com/Leaflet/Leaflet.heat) Leaflet Plugin.
### Demos
A live demo is available on the [Esri Leaflet website](http://esri.github.io/esri-leaflet/examples/visualize-points-as-a-heatmap.html).
A live demo can be found on the [Esri Leaflet website](http://esri.github.io/esri-leaflet/examples/visualize-points-as-a-heatmap.html).
### Example
Here is a quick example to get you started. Just change the paths to point to the proper libraries and go.
Here is a quick example to get you started.

@@ -26,4 +26,4 @@ <a href="http://esri.github.io/esri-leaflet/examples/visualize-points-as-a-heatmap.html">

<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>

@@ -33,7 +33,7 @@ <!-- Include Leaflet.heat via rawgit.com, do not use in production -->

<!-- Load Esri Leaflet from CDN -->
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/0.0.1-beta.6/esri-leaflet.js"></script>
<!-- Esri Leaflet -->
<script src="http://cdn.jsdelivr.net/leaflet.esri/2.0.0-beta.5/esri-leaflet.js"></script>
<!-- Load Heatmap Feature Layer from CDN -->
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet-heatmap-feature-layer/0.0.1-beta.1/esri-leaflet-heatmap-feature-layer.js"></script>
<script src="//cdn.jsdelivr.net/leaflet.esri.heatmap-feature-layer/2.0.0-beta.1/esri-leaflet-heatmap-feature-layer.js"></script>

@@ -53,3 +53,3 @@ <style>

L.esri.basemapLayer('Gray').addTo(map);
L.esri.heatmapFeatureLayer({
L.esri.Heat.heatmapFeatureLayer({
url: 'http://services.arcgis.com/rOo16HdIMeOBI4Mb/ArcGIS/rest/services/Graffiti_Reports/FeatureServer/0',

@@ -85,5 +85,5 @@ radius: 12

* [Leaflet](http://leaflet.com) version 0.7 or higher is required and the latest version is recommended.
* [Esri Leaflet](http://esri.github.io/esri-leaflet/) beta 5 or or higher is required but the latest version is recommended.
* [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) version 0.1.1 is required.
* [Leaflet](http://leaflet.com) version 0.7.3 is required.
* [Esri Leaflet](http://esri.github.io/esri-leaflet/) 1.0.0 is required.
* [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) version 0.1.3 is required.

@@ -90,0 +90,0 @@ ### Resources

@@ -19,3 +19,3 @@ describe('HeatmapFeatureLayer', function () {

beforeEach(function(){
layer = L.esri.heatmapFeatureLayer({
layer = L.esri.Heat.heatmapFeatureLayer({
url: 'http://services.arcgis.com/mock/arcgis/rest/services/MockService/MockFeatureServer/0',

@@ -22,0 +22,0 @@ timeField: 'time'

@@ -1,116 +0,94 @@

(function (factory) {
// define an AMD module that relies on 'leaflet'
if (typeof define === 'function' && define.amd) {
define(['leaflet', 'esri-leaflet'], function (L, Esri) {
return factory(L, Esri);
});
export var VERSION = '2.0.0-beta.1';
// define a common js module that relies on 'leaflet'
} else if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = factory(require('leaflet'), require('esri-leaflet'));
}
import L from 'leaflet';
import { FeatureManager } from 'esri-leaflet';
// define globals if we can find the proper place to attach them to.
if(window && window.L && window.L.esri) {
var HeatmapFeatureLayer = factory(L, L.esri);
export var HeatmapFeatureLayer = FeatureManager.extend({
/**
* Constructor
*/
window.L.esri.Layers.HeatmapFeatureLayer = HeatmapFeatureLayer;
initialize: function (options) {
FeatureManager.prototype.initialize.call(this, options);
window.L.esri.HeatmapFeatureLayer = HeatmapFeatureLayer;
options = L.setOptions(this, options);
window.L.esri.Layers.heatmapFeatureLayer = function(options){
return new HeatmapFeatureLayer(options);
};
this._cache = {};
this._active = {};
window.L.esri.heatmapFeatureLayer = function(options){
return new HeatmapFeatureLayer(options);
};
}
}(function (L, Esri) {
this.heat = window.L.heatLayer([], options);
},
var HeatmapFeatureLayer = Esri.Layers.FeatureManager.extend({
/**
* Constructor
*/
/**
* Layer Interface
*/
initialize: function (options) {
Esri.Layers.FeatureManager.prototype.initialize.call(this, options);
onAdd: function (map) {
FeatureManager.prototype.onAdd.call(this, map);
this._map.addLayer(this.heat);
},
options = L.setOptions(this, options);
onRemove: function (map) {
FeatureManager.prototype.onRemove.call(this, map);
this._map.removeLayer(this.heat);
},
this._cache = {};
this._active = {};
/**
* Feature Managment Methods
*/
this.heat = new window.L.heatLayer([], options);
},
createLayers: function (features) {
for (var i = features.length - 1; i >= 0; i--) {
var geojson = features[i];
var id = geojson.id;
var latlng = new L.LatLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0]);
this._cache[id] = latlng;
/**
* Layer Interface
*/
onAdd: function(map){
Esri.Layers.FeatureManager.prototype.onAdd.call(this, map);
this._map.addLayer(this.heat);
},
onRemove: function(map){
Esri.Layers.FeatureManager.prototype.onRemove.call(this, map);
this._map.removeLayer(this.heat);
},
/**
* Feature Managment Methods
*/
createLayers: function(features){
for (var i = features.length - 1; i >= 0; i--) {
var geojson = features[i];
var id = geojson.id;
var latlng = new L.LatLng(geojson.geometry.coordinates[1], geojson.geometry.coordinates[0]);
this._cache[id] = latlng;
// add the layer if it is within the time bounds or our layer is not time enabled
if(!this._active[id] && (!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)))){
this._active[id] = latlng;
this.heat._latlngs.push(latlng);
}
// add the layer if it is within the time bounds or our layer is not time enabled
if (!this._active[id] && (!this.options.timeField || (this.options.timeField && this._featureWithinTimeRange(geojson)))) {
this._active[id] = latlng;
this.heat._latlngs.push(latlng);
}
}
this.heat.redraw();
},
this.heat.redraw();
},
addLayers: function(ids){
for (var i = ids.length - 1; i >= 0; i--) {
var id = ids[i];
if(!this._active[id]){
var latlng = this._cache[id];
this.heat._latlngs.push(latlng);
this._active[id] = latlng;
}
addLayers: function (ids) {
for (var i = ids.length - 1; i >= 0; i--) {
var id = ids[i];
if (!this._active[id]) {
var latlng = this._cache[id];
this.heat._latlngs.push(latlng);
this._active[id] = latlng;
}
this.heat.redraw();
},
}
this.heat.redraw();
},
removeLayers: function(ids, permanent){
var newLatLngs = [];
for (var i = ids.length - 1; i >= 0; i--) {
var id = ids[i];
if(this._active[id]){
delete this._active[id];
}
if(this._cache[id] && permanent){
delete this._cache[id];
}
removeLayers: function (ids, permanent) {
var newLatLngs = [];
for (var i = ids.length - 1; i >= 0; i--) {
var id = ids[i];
if (this._active[id]) {
delete this._active[id];
}
for (var latlng in this._active){
newLatLngs.push(this._active[latlng]);
if (this._cache[id] && permanent) {
delete this._cache[id];
}
}
this.heat.setLatLngs(newLatLngs);
for (var latlng in this._active) {
newLatLngs.push(this._active[latlng]);
}
});
this.heat.setLatLngs(newLatLngs);
}
return HeatmapFeatureLayer;
}));
});
export function heatmapFeatureLayer (options) {
return new HeatmapFeatureLayer(options);
}
export default heatmapFeatureLayer;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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