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 🙏

© 2026 – Pkg Stats / Ryan Hefner

angularjs-mapbox

v1.0.13

Published

AngularJS MapBox library

Readme

angular-mapbox

AngularJS MapBox library

Installation

$   npm install angularjs-mapbox

Quick Start

  1. In your html, import the library <script src="node_modules/angularjs-mapbox/index.js"></script>
  2. Include the css (or scss) in your html <link rel="stylesheet" href="node_modules/angularjs-mapbox/angular-mapbox.css"></link>

HTML Example:

<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="node_modules/angularjs-mapbox/angular-mapbox.css">
</head>
<body ng-app="baseApp">
    <h2>Your amazing site goes here</h2>
    <div ng-controller="mapController">
        ...
    </div>

    <script src = "node_modules/angular/angular.min.js"></script>
    <script src="node_modules/angularjs-mapbox/index.js"></script>
    <script src="/path/to/your/javascript.js"></script>
</body>
</html>
  1. Import in the global modules' section:
var app = angular.module('baseApp', [
    'angularMapbox'
]);
  1. Add the key in the config section:
app.config(
    [
        'angularMapboxConfigProvider', 
        function(angularMapboxConfigProvider) {
            angularMapboxConfigProvider.config({
                accessToken: '<YOUR ACCESS TOKEN>'
            });
        }
    ]
);
  1. In your controller, declare some variables you'll use in the map for center and zoom
app.controller('mapController', function($scope) {
    $scope.map = {
        zoom: 12,
        center: [ -74.804486, 10.980780 ]
    };
});
  1. Create a new map!
<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="node_modules/angularjs-mapbox/angular-mapbox.css">
</head>
<body ng-app="baseApp">
    <h2>Your amazing site goes here</h2>
    <div ng-controller="mapController">
        <angular-mapbox-map zoom="map.zoom" center="map.center" design="'mapbox://styles/mapbox/dark-v9'">
        </angular-mapbox-map>
    </div>

    <script src="node_modules/angular/angular.min.js"></script>
    <script src="node_modules/angularjs-mapbox/index.js"></script>
    <script src="/path/to/your/javascript.js"></script>
</body>
</html>

Marker Example

You can create one or more markers in the map:

<angular-mapbox-map zoom="map.zoom" center="map.center" design="'mapbox://styles/mapbox/dark-v9'">
    <angular-mapbox-marker ng-repeat="marker in markers" model="marker" identificator="'id'"></angular-mapbox-marker>
</angular-mapbox-map>
app.controller('mapController', function($scope) {
    $scope.map = {
        zoom: 12,
        center: [ -74.804486, 10.980780 ]
    };

    $scope.markers = [{
        id: 'marker-1',
        lat: -74.804486,
        lng: 10.980780
    }, {
        id: 'marker-2',
        lat: -74.812486,
        lng: 10.985781
    }];
});

You can see more examples here

Directive Reference

Map [angular-mapbox-map]

| attribute | type | value | |-----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | zoom | numeric | The number of zoom | | center | array | [longitude, latitude] | | events | object | Refer to documentation for more information. See examples of how to use it. | | design | string | Some of predefined styles: - mapbox://styles/mapbox/streets-v10 - mapbox://styles/mapbox/outdoors-v10 - mapbox://styles/mapbox/light-v9 - mapbox://styles/mapbox/dark-v9 - mapbox://styles/mapbox/satellite-v9 - mapbox://styles/mapbox/satellite-streets-v10 - mapbox://styles/mapbox/navigation-preview-day-v2 - mapbox://styles/mapbox/navigation-preview-night-v2 - mapbox://styles/mapbox/navigation-guidance-day-v2 - mapbox://styles/mapbox/navigation-guidance-night-v2 |

Marker [angular-mapbox-marker]

| attribute | type | value | |---------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | model | object | an object with the required values: lat, lng and additional a id field that should be unique. See examples for more information | | identificator | string | the value inside the model who has the identificator name (unique). Example: 'id' | | events | object | Refer to documentation for more information. See ./examples of how to use it. Additional, you can set events like click to the addEventListener include on the market itself. See this documentation |

Circle [angular-mapbox-circle]

| attribute | type | value | |---------------|--------|--------------------------------------------------------------------------------------------------------| | center | Array | An array with longitude, latitude | | identificator | string | A unique name for the object. Example: 'my-circle-id' | | radius | number | The radius of the circle (see unit) | | unit | string | unit used on the radius: px (pixels), m (meters), km (kilometers) | | layout | object | Options for layout (See documentation) | | paint | object | Options for paint (See documentation) |

GeoJSON [angular-mapbox-geojson]

| attribute | type | value | |---------------|--------|------------------------------------------------------------------------------------------------------------------------------| | identificator | string | the value inside the model who has the identificator name (unique). Example: 'id' | | type | string | The type of the Layer you want to create (See documentation) | | data | object | The source of the geojson. See documentation | | layout | object | Options for layout (See documentation) | | paint | object | Options for paint (See documentation) |

To Do

  • Finish Examples
  • Finish documentation for geojson
  • Finish documentation for popup
  • Develop more stuff for mapboxgl library