Socket
Socket
Sign inDemoInstall

mapbox

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapbox - npm Package Compare versions

Comparing version 0.0.0 to 0.1.0

grenada.png

31

index.js
var request = require('request');
module.exports = (function() {
var api_key = null;
module.exports = function(api_key) {
if (!api_key) return new Error('API Key Required');
var mapbox = {};
var mapbox = {},
base = 'http://api.tiles.mapbox.com/v3/';

@@ -15,10 +16,22 @@ mapbox.apiKey = function(_) {

mapbox.geocode = function(_, cb) {
if (!api_key) return cb(new Error('API Key Required'));
request({
url: 'http://api.tiles.mapbox.com/v3/' + api_key + '/geocode/' + encodeURIComponent(_) + '.json',
json: true
}, cb);
return request({
url: base + api_key + '/geocode/' + encodeURIComponent(_) + '.json',
});
};
mapbox.static = function(_, cb) {
var markers = '';
if (_.markers) {
markers = _.markers.map(function(m) {
return 'pin-m(' + [m.lon, m.lat].join(',') + ')';
}).join(',') + '/';
}
return request({
url: base + api_key + '/' +
markers +
[_.lon, _.lat, _.z].join(',') + '/' + [_.width || 640, _.height || 320].join('x') + '.png'
});
};
return mapbox;
})();
};
{
"name": "mapbox",
"version": "0.0.0",
"version": "0.1.0",
"description": "an api for mapbox",

@@ -9,2 +9,5 @@ "main": "index.js",

},
"bin": {
"mapbox-static": "mapbox-static"
},
"repository": {

@@ -26,3 +29,9 @@ "type": "git",

},
"homepage": "https://github.com/mapbox/node-mapbox"
"homepage": "https://github.com/mapbox/node-mapbox",
"dependencies": {
"minimist": "0.0.8",
"superenv": "0.0.1",
"request": "~2.34.0",
"concat-stream": "~1.4.4"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc