jperelli / osm-static-maps

Openstreetmap static maps is a nodejs lib, CLI and server open source inspired on google static map service
http://osm-static-maps.herokuapp.com/
GNU General Public License v2.0
160 stars 52 forks source link

vectorserverUrl layers not working #50

Closed majid-saeed closed 2 months ago

majid-saeed commented 5 months ago

I am trying to get a print/image by using a simple vectorserver layer with style.json getting different behaviors if I enable the renderToHtml it gives the correct layer and renders fines.

but disabling it gives the timeout and its linked with rendering. first of all the Puppeteer throws CORS errors, disabled it with '--disable-web-security', '--disable-features=IsolateOrigins,site-per-process'

then it throws PAGE LOG: [.WebGL-0x6f00048b100]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels

which is because of rendering, cant disable the WebGL because its being used for map rendering.

can test it with http://localhost:3000/?geojson=[{"type":"Feature","properties":{"party":"Republican"},"geometry":{"type":"Polygon","coordinates":[[[-104.05,48.99],[-97.22,48.98],[-96.58,45.94],[-104.03,45.94],[-104.05,48.99]]]}},{"type":"Feature","properties":{"party":"Democrat"},"geometry":{"type":"Polygon","coordinates":[[[-109.05,41.00],[-102.06,40.99],[-102.03,36.99],[-109.04,36.99],[-109.05,41.00]]]}}]&vectorserverUrl=https://api.maptiler.com/maps/topo/style.json?key=gbetYLSD5vR8MdtZ88AQ&height=200&width=200&zoom=20&center=-74.0060,40.7128&timeout=1200000&scale=false&markerIconOptions=false&style=false&oxipng=true

removed the token.

if you add renderToHtml then it gives the correct page.

tested with node v18, v16, v12

jperelli commented 2 months ago

thanks! fixed in v4.0.1