Coder Social home page Coder Social logo

gitsunww / map-tile-downloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ianwcarlson/map-tile-downloader

0.0 1.0 0.0 23 KB

[Unsupported] NodeJS module that calculates a square area and downloads all the map tiles contained in that area

License: MIT License

JavaScript 100.00%

map-tile-downloader's Introduction

[Unsupported] map-tile-downloader

NodeJS module that calculates a square area and downloads all the map tiles contained in that area at the specified zoom levels. The tiles can then be served up locally with a simple static file web server and a client-side map engine like Leaflet. Eventually I'd like to provide a basic map server here.

Note when using Mapbox, you need to create an account and a new project and then fill in the properties accordingly.

Example usage:

var options = {
	baseUrl: 'http://api.tiles.mapbox.com/v4/<your username>.<map project ID>',
	rootDir: 'mapbox/',
	mapSourceSuffix: '.jpg90?access_token=<API access token>',
	inputCoordinates: {
		lat: 33.0,
		lng: -106.0,
		sqKms: 0.1
	},
	xBeforeY: true
};

var mapDownloader = require('./map-tile-downloader.js')(options);
mapDownloader.run(function(err){
	console.log(err);
	process.exit();
});

This module really only supports servers that comply with the TMS (Tile Map Service) format. Go here for more info. There are slight variations in how the URL is constructed but I accounted for the variations that I know of.

Please comply with the map provider license agreement. Not all providers allow people to freely store their content locally (Google).

The test directory provides some example of how to use this module (specifically in map-tile-downloader-spec.js).

This repo is still a work in progress, but it should hopefully be helpful.

Installation

  • Install Node
  • Install Git
  • Git clone this repo git clone https://github.com/ianwcarlson/map-tile-downloader in your development directory
  • Navigate to new project file and Install NPM packages
npm install
npm install -g gulp jsdoc jasmine-node

Documentation

gulp docs

Test

jasmine-node test/ from root directory

map-tile-downloader's People

Contributors

ianwcarlson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.