npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-leaflet-light

v0.2.1

Published

Angular Leaflet Light =====================

Downloads

19

Readme

Angular Leaflet Light

NPM

Travis CI Codacy Badge semantic-release Commitizen friendly

Quality Coverage Status [![Circle CI] circle-icon ]circle-url

dependencies devdependencies

This project aims at providing a leaflet integration for angularjs.

Please show me examples

Example 1: Default Source

Example 2: sync center&zoom Source

Example 3: geojson Source

How to install

install using npm

npm install --save angular-leaflet-light

create example.js file

angular.module('MyApp', ['angular-leaflet']);

create index.html file

<html>
	<head>
		<title>angular leaflet default</title>
		<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script type="text/javascript" src="https://unpkg.com/[email protected]/angular.js"></script>
		<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
		
		<script type="text/javascript" src="node_modules/angular-leaflet-light/dist/angular-leaflet.js"></script>
		
		<script type="text/javascript" src="example.js"></script>
		<style type="text/css">
		#map {
			height: 500px;
		}
		</style>
	</head>
<body ng-app="example" ng-strict-di ng-cloak>
    <leaflet></leaflet>
</body>
</html>

Why do not use angular-leaflet from tombatossals ?

The first integration of leaflet in angular has been done by David Rubert aka tombatossals:

https://github.com/tombatossals/angular-leaflet-directive

Now this project is maintains and updated by the famous angular-ui team:

https://github.com/angular-ui/ui-leaflet

So why should I do it again ? Because both provide something that is not leaflet.

Theses projects provides advanced integration into angular but ...

  • geojson (why the hell should I have only one geojson)
  • slow on mobile (may be because there are lots of watchers on quite big objects)
  • hard to customize (try to create a directive that wrap it...)

I have use tombatossals's implementation on many project before that time where I find how I would like it to be.

So what is angular leaflet light ?

A simple directive that display a map and provide a callback with the map object, so you can do what ever you want.

A simple service add some common utils to handle things like compile popup with your data from the scope + default settings for all leaflet maps (using in the init so no watcher on it).

<leaflet id="mymap" on-map-initialized="customizeMyMap(map)"></leaflet>

You can also access the map using the service:

leafletService.data.mymap;