Skip to content

Commit

Permalink
update readme, minor doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jseppi committed Apr 30, 2016
1 parent cca7546 commit 980f2dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions Leaflet.MakiMarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
*
* References:
* Maki Icons: https://www.mapbox.com/maki/
* MapBox Marker API: https://www.mapbox.com/developers/api/static/#markers
* Mapbox Marker API: https://www.mapbox.com/api-documentation/#retrieve-a-standalone-marker
*
* Usage:
* L.MakiMarkers.accessToken = "<YOUR_ACCESS_TOKEN>";
* var icon = L.MakiMarkers.icon({icon: "rocket", color: "#b0b", size: "m"});
*
* License:
Expand All @@ -32,6 +33,7 @@
"swimming","telephone","tennis","theatre","toilets","town-hall","town","triangle-stroked",
"triangle","village","warehouse","waste-basket","water","wetland","zoo"
],
accessToken: null,
defaultColor: "#0a0",
defaultIcon: "circle-stroked",
defaultSize: "m",
Expand All @@ -50,8 +52,6 @@
}
};

L.MakiMarkers.accessToken = null;

L.MakiMarkers.Icon = L.Icon.extend({
options: {
//Mapbox API access token, see https://www.mapbox.com/api-documentation/?language=CLI#access-tokens
Expand Down Expand Up @@ -94,7 +94,6 @@
break;
}


pin = "pin-" + options.size;

if (options.icon !== null) {
Expand All @@ -109,8 +108,6 @@
pin += "+" + options.color;
}



options.iconUrl = "" + L.MakiMarkers.apiUrl + pin + ".png" + tokenQuery;
options.iconRetinaUrl = L.MakiMarkers.apiUrl + pin + "@2x.png" + tokenQuery;
}
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Leaflet.MakiMarkers

[Leaflet](http://www.leafletjs.com) plugin to create map icons using [Maki Icons](https://www.mapbox.com/maki/) from Mapbox. Markers are retrieved from Mapbox's [Static Marker API](https://www.mapbox.com/developers/api/static/#markers).
[Leaflet](http://www.leafletjs.com) plugin to create map icons using [Maki Icons](https://www.mapbox.com/maki/) from Mapbox. Markers are retrieved from Mapbox's [Static Marker API](https://www.mapbox.com/api-documentation/#retrieve-a-standalone-marker).

[![Screenshot](https://raw.github.com/jseppi/Leaflet.MakiMarkers/master/images/screenshot.png "Screenshot of MakiMarkers")](http://jsfiddle.net/Zhzvp/)
[![Screenshot](https://raw.github.com/jseppi/Leaflet.MakiMarkers/master/images/screenshot.png "Screenshot of MakiMarkers")]

## Usage

Simply include `Leaflet.MakiMarkers.js` in your page after you include `Leaflet.js`: `<script src="Leaflet.MakiMarkers.js"></script>`
Include `Leaflet.MakiMarkers.js` in your page after you include `Leaflet.js`: `<script src="Leaflet.MakiMarkers.js"></script>`

The most recent version of Mapbox's static API (v4) requires that a valid access token be specified with every request. Please see https://www.mapbox.com/api-documentation/?language=CLI#access-tokens for more information.

```js
//First, specify a valid Mapbox API access token (see https://www.mapbox.com/api-documentation/?language=CLI#access-tokens)
//First, specify your Mapbox API access token
L.MakiMarkers.accessToken = "<YOUR_ACCESS_TOKEN>";

// Specify a Maki icon name, hex color, and size (s, m, or l).
Expand All @@ -20,8 +22,6 @@ var icon = L.MakiMarkers.icon({icon: "rocket", color: "#b0b", size: "m"});
L.marker([30.287, -97.72], {icon: icon}).addTo(map);
```

[JSFiddle Demo](http://jsfiddle.net/Zhzvp/26/)

## Requirements

[Leaflet](http://www.leafletjs.com) 0.5+
Expand Down

0 comments on commit 980f2dc

Please sign in to comment.