
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
angular-leaflet-directive
Advanced tools
angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps
AngularJS directive for the Leaflet Javascript Library. This software aims to easily embed maps managed by leaflet on your Leaflet project.
See some basic examples:
To see it in action, go to the main page where you can find more examples and some documentation:
You must include the leaflet-directive dependency on your angular module:
var app = angular.module("demoapp", ["leaflet-directive"]);
After that, you can change the default values of the directive (if you want) on your angular controller. For example, you can change the tiles source, the maxzoom on the leaflet map or the polyline path properties.
angular.extend($scope, {
defaults: {
tileLayer: "http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",
maxZoom: 14,
path: {
weight: 10,
color: '#800000',
opacity: 1
}
}
});
If you want to set the start of the map to a precise position, you can define the "center" property of the scope (lat, lng, zoom). It will be updated interacting on the scope and on the leaflet map in two-way binding. Example:
angular.extend($scope, {
center: {
lat: 51.505,
lng: -0.09,
zoom: 8
}
});
Finally, you must include the markup directive on your HTML page, like this:
<leaflet defaults="defaults" center="center" height="480px" width="640px"></leaflet>
v0.7.3 (2014-01-11)
The most important change of this release is the overhaul of the markers attribute, which has some implications to mantain backwards compatibility. The icon definition inside a marker must be done without calling explicitly Leaflet Icon creation function. So, instead of:
marker = {
name: "example",
icon: L.icon({
...
})
}
We will use:
marker = {
name: "example",
icon: {
...
}
}
You can take a look at the demo page to see examples of this change: http://tombatossals.github.io/angular-leaflet-directive/#!/examples/customized-markers
<a name="v0.7.2"></a>
FAQs
angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps
The npm package angular-leaflet-directive receives a total of 4,760 weekly downloads. As such, angular-leaflet-directive popularity was classified as popular.
We found that angular-leaflet-directive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.