Giter Club home page Giter Club logo

mapbox-gl-esri-sources's Introduction

mapbox-gl-esri-sources

A small library to make it easier to use various Esri Services on a mapbox-gl map.

Note This library is compatible with both mapbox-gl and maplibre-gl.

Currently supports

  • Esri Map Services
    • Dynamic
    • Tiled
  • Esri Vector Tile Services
  • Esri Vector Basemap Styles

Installation & Use

npm install mapbox-gl-esri-sources

Usage

Check out the docs

Acknowledgements

  • Esri-Leaflet was one of the first open-source projects I used and contributed to. It's still a fantastic piece of work that I refered to for inspiration (and stealing some words for documentation).
  • Mapbox-gl is an incredible front-end mapping library.

mapbox-gl-esri-sources's People

Contributors

madole avatar rowanwins avatar underbluewaters 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

Watchers

 avatar  avatar  avatar

mapbox-gl-esri-sources's Issues

Identify requests does not work when layer default visibility is false

Hi @rowanwins

The identify request does not work when the queried layer has default visibility property as false ("defaultVisibility": false).

In this sample https://codepen.io/PedroNGV/pen/wvxgmOp :

  • Elevation layer returns the identify output as expected;
  • Slope layer does not return nothing.

The diference between both layers is:

  • Elevation has Default Visibility: true;
  • Slope has Default Visibility: false.

Looking at the request:
https://sigservices.icnf.pt/server/rest/services/BDG/LF_PT_RELEVO/MapServer/identify?sr=4326&geometryType=esriGeometryPoint&geometry=%7B%22x%22%3A-7.065627735444195%2C%22y%22%3A40.77396674193105%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D&tolerance=3&returnGeometry=false&imageDisplay=1920%2C553%2C96&mapExtent=-7.082986992188637%2C40.77110672954365%2C-7.050028007813523%2C40.77830527567522&layers=show%3A14&layerDefs=false&time=false&f=json

I see layers=show:14

which came from
https://github.com/frontiersi/mapbox-gl-esri-sources/blob/master/src/DynamicMapService.js#L42
and
https://github.com/frontiersi/mapbox-gl-esri-sources/blob/master/src/DynamicMapService.js#L156

I've checked how esri-leaflet deal with identify requests, and it seems to use visible: (layers=visible:14) instead of show:
https://github.com/Esri/esri-leaflet/blob/daebcc8f69930a90b4ec726b0eb34fbe393d90af/src/Layers/DynamicMapLayer.js#L100

Changing https://github.com/frontiersi/mapbox-gl-esri-sources/blob/master/src/DynamicMapService.js#L156 to use visible:, the output already came as expected, both in Elevation and Slope layers.

Do you think this change should be applied?

Thanks!

Consider adding support for FeatureServices

Various Esri Services (name FeatureServer and MapServer) can be queried to return geojson which can then be displayed on a map.

To do this naively is quite simple, you can just pass in a query parameter &where=1=1, this gives you back all the data. The problem is that the response size could be really big depending on how many features there are.

A more sophisticated approach uses getting data on a per-tile basis, this is how esri-leaflet tackles it. This approach is alot more scalable as you only retrieve the geojson for the area you're looking at, and you can also adjust precision and simplicity depending on scale etc.
This would be awesome, but requires writing a custom-source for mapbox-gl, and this is somewhat undocumented, and would require a stack more code.

Choices choices....

Identify features from a Dynamic Map Service are shown when layer is not visible

Hi,

I'm trying the Identify features from a Dynamic Map Service, and the identify output is shown even when the layer is disabled by the maplibre-gl-legend module. Here is a sample:

https://codepen.io/PedroNGV/pen/PoBWNpM

imagem

The expected behaviour would be the popup not be shown when the layer is disabled, like in the default popup (https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/).

Do you think this is a bug? Or just a misconfiguration?

Thanks!

TypeScript support

Hi,

awesome library! Do you plan on providing TypeScript support and types at some point?

Could not find a declaration file for module 'mapbox-gl-esri-sources'.
Try `npm i --save-dev @types/mapbox-gl-esri-sources` if it exists or add a new declaration (.d.ts) file containing `declare module 'mapbox-gl-esri-sources';`

BR
Marco

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.