RiceaRaul / gta-v-map-leaflet

The map for gta v, ragemp and fivem made in leaflet
MIT License
54 stars 14 forks source link

How to add a custom map? #5

Open emanueldev1 opened 1 year ago

emanueldev1 commented 1 year ago

How to add a custom map?

emanueldev1 commented 1 year ago

Skill issues

What?

SaiCode-DEV commented 1 year ago

You first have to get a image of a custom map and match it to the existing maps (to keep scale etc).

Then you need to use a tool like https://hub.docker.com/r/niene/gdal2tiles-leaflet (the best still working) to slice the singe one layer into multible smaller ones. i used: sudo docker run --rm -v `pwd`:/data niene/gdal2tiles-leaflet -l -p raster -z 0-5 -w none /data/gta-darkmode-map.png /data/gta-darkmode-map/ Lastly you can add it as an additional tyle layer in the script.

SaiCode-DEV commented 1 year ago

the file i used was: https://workupload.com/file/puUd5xQZwcs but you can use whatever image you want (or you can send it here if help is needed)

SaiCode-DEV commented 1 year ago

Skill issues

And perhaps a little bit less toxic might be useful... Even though i hate QuasarStore because of their horrible Support after purchasing the Phone script..

Shotman commented 1 year ago

You first have to get a image of a custom map and match it to the existing maps (to keep scale etc).

Then you need to use a tool like https://hub.docker.com/r/niene/gdal2tiles-leaflet (the best still working) to slice the singe one layer into multible smaller ones. i used: sudo docker run --rm -v `pwd`:/data niene/gdal2tiles-leaflet -l -p raster -z 0-5 -w none /data/gta-darkmode-map.png /data/gta-darkmode-map/ Lastly you can add it as an additional tyle layer in the script.

~~I've tried your docker container and I just overlapped my map over an existing one from the styles provided but it doesn't work, any parameters I should add ? The JS console shows errors like this : file:///D:/Dev/gta-v-map-leaflet/mapStyles/styleCustom/1/0/0.jpg net::ERR_FILE_NOT_FOUND And I see the file tree of my custom map doesn't match the ones provided, so maybe there is an issue configuring the docker component, like centering etc ?~~

I used it as is and saw that the command created png files so I went there https://stackoverflow.com/questions/6863021/convert-all-images-to-jpg and used the function with the -recurse argement on the GetChildItem command to convert everything to jpg and it works. If that can help someone