You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need some help to export a map shown with Mapbox to svg.
It's working pretty well as you can see below. The only problem is the blue mask (Multipolygon case), even if i put the fill-rule. Someone already tried to export ? Or if someone can help me. 🙏🙏
Map shown:
SVG Result
Here the code.
Export function:
consthandleGenerateMap=()=>{if(mapRef.current){// Capturez l'image de la carte et générez un fichier EPSconstfeatures=mapRef.current.queryRenderedFeatures().reverse();// const svg = mapCanvasToSvg(mapCanvas);constsvg=mapFeaturesToSvg(features,mapRef.current,actualTheme.color2,mapRef.current.getZoom());constblob=newBlob([svg],{type: "image/svg+xml"});constlink=document.createElement("a");link.href=URL.createObjectURL(blob);link.download="map.svg";link.click();}};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone!
I need some help to export a map shown with Mapbox to svg.
It's working pretty well as you can see below. The only problem is the blue mask (Multipolygon case), even if i put the fill-rule. Someone already tried to export ? Or if someone can help me. 🙏🙏
Map shown:
SVG Result
Here the code.
Export function:
Export function:
Beta Was this translation helpful? Give feedback.
All reactions