lightning-maps
Advanced tools
Comparing version 0.0.4 to 0.0.6
{ | ||
"name": "lightning-maps", | ||
"version": "0.0.4", | ||
"description": "Lightweight, dependency-free slippy map renderer", | ||
@@ -8,3 +7,3 @@ "main": "lib/LightningMaps.js", | ||
"build": "webpack --env dev && webpack --env build && cp lib/LightningMaps.min.js docs/LightningMaps.js && npm run test", | ||
"dev": "rm docs/LightningMaps.js && webpack-dev-server --progress --colors --watch --env dev", | ||
"dev": "rm -f docs/LightningMaps.js && webpack-dev-server --progress --colors --watch --env dev", | ||
"test": "mocha --require babel-register --colors ./test/*.spec.js", | ||
@@ -45,8 +44,12 @@ "test:watch": "mocha --require babel-register --colors -w ./test/*.spec.js" | ||
"mocha": "^4.0.1", | ||
"uglifyjs-webpack-plugin": "^1.2.7", | ||
"webpack": "^4.12.2", | ||
"webpack-cli": "^3.0.8", | ||
"webpack-dev-server": "^3.1.10", | ||
"webpack-dev-server": "^3.1.11", | ||
"yargs": "^10.0.3" | ||
} | ||
}, | ||
"dependencies": { | ||
"d3-geo": "^1.11.3", | ||
"topojson-client": "^3.0.0" | ||
}, | ||
"version": "0.0.6" | ||
} |
# Lightning Maps (*Alpha release*) | ||
A lightweight, dependency-free slippy map renderer. | ||
A lightweight, minimal-dependecy slippy map renderer. | ||
@@ -10,3 +10,3 @@ Heavily inspired by [Pigeon Maps](https://github.com/mariusandra/pigeon-maps) and [Leaflet](https://leafletjs.com), but with slightly different goals in mind: | ||
* Modern, built using ES6+ syntax | ||
* Lightweight, [absolutely zero dependencies](https://github.com/Geocodio/lightning-maps/blob/master/package.json#L28) with a [minified bundle](https://raw.githubusercontent.com/Geocodio/lightning-maps/master/lib/LightningMaps.min.js) of less than 20kb | ||
* Lightweight, [minimal dependencies](https://github.com/Geocodio/lightning-maps/blob/master/package.json#L28) with a [minified bundle](https://raw.githubusercontent.com/Geocodio/lightning-maps/master/lib/LightningMaps.min.js) of less than 20kb | ||
* Ability to render thousands of markers, by using `<canvas>` rendering instead of depending on the DOM | ||
@@ -13,0 +13,0 @@ * Wrappers for React and VueJS (Coming soon) |
@@ -76,1 +76,9 @@ export const defaultMapOptions = { | ||
}; | ||
export const defaultPolygonOptions = { | ||
/** | ||
* What color should the polygon be? | ||
* Supports hex, rgb and rgba values | ||
*/ | ||
color: 'rgba(0, 0, 200, 0.7)' | ||
}; |
import Map from './Map'; | ||
import Marker from './Marker'; | ||
import Polygon from './Polygon'; | ||
export default { | ||
Map, | ||
Marker | ||
Marker, | ||
Polygon | ||
}; |
import TileConversion from './TileConversion'; | ||
import TileLayer from './TileLayer'; | ||
import MapState from './MapState'; | ||
import { defaultMapOptions } from './defaultOptions'; | ||
@@ -44,2 +45,3 @@ | ||
markers: [], | ||
polygons: [], | ||
tileLayers: [ | ||
@@ -370,2 +372,3 @@ new TileLayer(this) | ||
this.drawMarkers(); | ||
this.drawPolygons(); | ||
this.drawAttribution(); | ||
@@ -426,2 +429,16 @@ } | ||
drawPolygons() { | ||
const mapState = new MapState( | ||
this.options.center, | ||
this.options.zoom, | ||
this.options.tileSize, | ||
this.state.canvasDimensions, | ||
this.state.moveOffset | ||
); | ||
this.state.polygons.map(polygon => { | ||
polygon.render(this.context, mapState); | ||
}); | ||
} | ||
drawAttribution() { | ||
@@ -470,2 +487,6 @@ const margin = 4; | ||
addPolygon(polygon) { | ||
this.state.polygons.push(polygon); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
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
1532622
18
34
7505
2
5
+ Addedd3-geo@^1.11.3
+ Addedtopojson-client@^3.0.0
+ Addedcommander@2.20.3(transitive)
+ Addedd3-array@1.2.4(transitive)
+ Addedd3-geo@1.12.1(transitive)
+ Addedtopojson-client@3.1.0(transitive)