0

My GeoJSON map is published by Leaflet, how can prevent download from user who want to steal it?

I'd taken long time to prepare GeoJSON and I want to preserve my effort.

Any suggestion? Do I need to choose another library/framework?

https://pulliver.github.io/osm_amministrative_2022/index.html?param=1

With this map, it's possible to visualize the election result block by block

3
  • 1
    if its on the internet... but you could use a database and php to hide the data stackoverflow.com/questions/34843393/php-mysql-and-leaflet-api +reverse proxy tied to your servers ip/dns.
    – Mapperz
    Jun 29 at 21:26
  • 2
    Since GeoJSON ise rendered client side, you can't protect it. The closest you could get to some kind of protection would be to convert it to vector tiles.
    – TomazicM
    Jun 29 at 21:36
  • 2
    As others have said, if someone can see it in a browser they have access to it. Vector tiles is a good idea. Or you could at least make the JSON less convenient for people to scrape. For example, base64-encode the JSON string and scramble that, so it looks like the page is downloading jibberish. Then minify the javascript code that reverses it, so it's not obvious what the transmitted format is. If someone wants it they'd have to be determined enough to study how your application works, instead of just viewing the source
    – mikewatt
    Jun 29 at 21:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.