abhi shukla
abhi shukla

Reputation: 1179

Drawing a image overlay on react-map-gl

I want to a floor plan layer with give coordinates on mapbox. I am using react-map-gl. (https://github.com/uber/react-map-gl). How can I draw a image overlay of on the map. Can you please quote some example or something.

Upvotes: 1

Views: 3222

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126065

You can overlay an image using the image type of source. For instance:

"sources": {
        "overlay": {
            "type": "image",
            "url": "https://www.mapbox.com/mapbox-gl-js/assets/radar.gif",
            "coordinates": [
                [-80.425, 46.437],
                [-71.516, 46.437],
                [-71.516, 37.936],
                [-80.425, 37.936]
            ]
        }
    },
    ...

From the example here.

Upvotes: 2

Related Questions