Skip to content

generate a map server side and save/return it as png image

Notifications You must be signed in to change notification settings

mtt87/nft-map-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFT map generator

Request a new map to be generated with latitude and longitude params, for example http://localhost:3000/maps?lat=45.3579&lng=9.4427

The server will user Playwright to start a browser in headless mode, inject the base.html content into the page and then inject the script to generate the map with the requested coordinates.

The image is saved as map.png and also returned as a response to the browser, you can change the path where it's saved or disable saving on disk.

You can customize the size of the image by changing both the css inside base.html and the viewport/screen properties of the headless browser spawned by playwright.

For the demo I'm using OpenLayers map because it doesn't require an API key but you can use any library you want because at the end of the day it's rendering HTML and saving the screenshot of the page.

About

generate a map server side and save/return it as png image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published