on-internet
← Community

Use svg image as map layer for mapbox GL JS

Stack Overflow ·

How do I use SVG image as the base map for mapbox GL JS ? I know, that OpenLayers and Leaflet provide such opportunity for developers. Leaflet: var svgUrl = 'image.svg', imageBounds = [[0, 0], [100, 100]]; L.imageOverlay(svgUrl , imageBounds).addTo(map); OpenLayers: var svgUrl = 'image.svg', var imgLayer = new ImageLayer({ source: new Static({ url: svgUrl, projection: projection, imageExtent: extent, imageLoadFunction: function (image, src) { image.getImage().src = src; image.getImage().width = olExtent.getWidth(extent); image.getImage().height = olExtent.getHeight(extent); }, }), }); map.addL

Comments

Sign in or sign up to comment and upvote.

No comments yet.