Giter Club home page Giter Club logo

mapbox-gl-arcgis-tiled-map-service's Introduction

Mapbox GL Custom Source for ArcGIS Tiled Map Services

2020 UPDATE

This is no longer needed, most tiles services on AGOL, and newer versions of Server for ArcGIS are creating using compatible Web Mercator projections and zoom levels.

Here is an update to the usage sample below using only the mapbox-gl-js built-in raster source:

var map = new mapboxgl.Map({
  /* ... */
});

map.addSource('amazon-human-footprint', {
    "type": "raster",
    "url": "https://tiles.arcgis.com/tiles/RTK5Unh1Z71JKIiR/arcgis/rest/services/HumanFootprint/MapServer/tile/{z}/{y}/{x}",
    "tileSize": 256
});

map.addLayer({
  "id": "amazon-human-footprint",
  "type": "raster",
  "source": "amazon-human-footprint",
  "minzoom": 0,
  "maxzoom": 18,
  "paint": {
    "raster-opacity": 75
  });

This may still be useful if you need to support older servers, or tile services not using the standard LOD.

Original Readme

This is an unofficial plugin, and is not affliated with Mapbox or Esri. 😇

⚠️🚧 Custom sources are still under development and have not yet been publicly documented. This custom source also depends on code above and beyond the API. This may break with future versions of mapbox-gl. 🚧⚠️

  • version 0.1.2 = tested with mapbox-gl-js v0.36.0
  • version 0.2.0 = tested with mapbox-gl-js v0.43.0
  • version 0.4.0 = tested with mapbox-gl-js v1.1.0
  • version 0.5.0 = tested with mapbox-gl-js v1.4.0

🚦Limitations🚦

Installation

npm install mapbox-gl-arcgis-tiled-map-service

or

yarn add mapbox-gl-arcgis-tiled-map-service

Usage

var ArcGISRasterTileSource = require('mapbox-gl-arcgis-tiled-map-service');
var map = new mapboxgl.Map({
  /* ... */
});
map.addSourceType('arcgisraster', ArcGISRasterTileSource, function(err) {
  if(err){
    /*do something*/
  }
});

map.addSource('amazon-human-footprint', {
    "type": "arcgisraster",
    "url": "https://tiles.arcgis.com/tiles/RTK5Unh1Z71JKIiR/arcgis/rest/services/HumanFootprint/MapServer?f=json",
    "tileSize": 256
});

map.addLayer({
  "id": "amazon-human-footprint",
  "type": "raster",
  "source": "amazon-human-footprint",
  "minzoom": 0,
  "maxzoom": 18,
  "paint": {
    "raster-opacity": 75
  });

Development

Build: npm run build-dev

License

MIT

Attributions

Some code was adapted from https://github.com/Leaflet/Leaflet and https://github.com/Esri/esri-leaflet

mapbox-gl-arcgis-tiled-map-service's People

Contributors

kriscarle avatar shane98c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mapbox-gl-arcgis-tiled-map-service's Issues

Missing "assert" in dist

Not sure if intentional or not but the "assert" function is not baked into the dist source making it fail.
Creating a global(window) level assert function makes it run again.

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.