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

Blank backgorund #21

Closed paulsUsername closed 4 years ago

paulsUsername commented 4 years ago

Is it possible to have a blank background and just return the drawn polyline/markers?

paulsUsername commented 4 years ago

Resolved this by using a mapbox layer designed to be blank, the using ImageMagick to remove the background color.

For anyone that is looking to do the same:

  1. Install ImageMagick (npm install imagemagick)

  2. run "convert file-name.png -channel rgba -alpha set -fuzz 85% -fill none -opaque "#ffffff" file-name.png" (this assumes that yourpolyline is white. Otherwise adjust the color to the color of your polyline)