user6694839
user6694839

Reputation: 389

consume ArcGIS Server REST services API into MapBox GL API

Can I consume ArcGIS Server REST services API into MapBox GL API? Please can anyone tell me whether I can consume an ArcGIS Rest Service into MapBox GIS. Thanks!!

Upvotes: 3

Views: 2868

Answers (2)

zhimin
zhimin

Reputation: 3050

You can use Esri's arcgis-to-geojson-utils to convert arcgis rest services featureset result to geojson format, which can be used with mapbox-gl.

Upvotes: 0

Bjorn Svensson
Bjorn Svensson

Reputation: 888

You can use GeoJSON as your go-between format for feature services. ArcGIS Server supports GeoJSON since version 10.4 and MapBox GL API supports reading GeoJSON.

Here's a snippet:

map.on('load', function () {
    // Add a layer showing the city parks
    map.addLayer({
        'id': 'parks-layer',
        'type': 'fill',
        'source': {
            'type': 'geojson',
            'data': 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/City_of_Redlands_Parks/FeatureServer/0/query?where=1%3D1&outSR=4326&f=pgeojson'
        },
        'paint': {
            'fill-color': 'rgba(200, 100, 240, 0.3)',
            'fill-outline-color': 'rgba(200, 100, 240, 1)'
        }
    });
});

Upvotes: 5

Related Questions