有没有办法使用 OpenLayers 更改 openstreetmap 中某些要素的颜色?

发布于 2024-12-18 10:52:44 字数 188 浏览 0 评论 0原文

我正在使用 OpenLayers 来显示 openstreetmap。有没有办法编辑地图上的某些功能?例如改变水的颜色、消除国家之间的边界等。如果不能使用 JavaScript 来完成,我猜还有其他方法可以做到这一点 - 比如托管您自己的地图版本,然后您可以对其进行编辑只要你想要的。

有人尝试过这样的事情吗?我该怎么做呢?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单挑你×的.吻 2024-12-25 10:52:44

不,您无法更改 OpenLayers.Layer.OSM 中的颜色,因为它会渲染死图像,并在服务器端应用所有样式。运用自己风格的唯一方法就是亲自主持 osm。以下教程将帮助您入门。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文