Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change the color of certain features in an openstreetmap using OpenLayers?

I'm using OpenLayers to display an openstreetmap. Is there a way to edit certain features on the map? For example changing the color of the water, removing the border between countries etc. If it can not be done using JavaScript, I'm guessing there are other ways to do this - like hosting your own version of the map which you can then edit as much as you want.

Has anyone tried something like this? How would I go about doing this?

Thanks

like image 953
Challe Avatar asked Oct 12 '25 21:10

Challe


1 Answers

No, you can't change colors in OpenLayers.Layer.OSM because it's rendered dead images with all styling applied on the server-side. Only way to apply your own style is to host osm yourself. Here's the tutorial that will help you get started.

like image 104
igorti Avatar answered Oct 14 '25 10:10

igorti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!