Zh-hans:Deploying your own Slippy Map
部署网络地图是使用OSM地图的通常办法。通常这意味着使用一些JavaScript代码整合一张展示地图瓦片的网络地图到你的网页上。
![]() | 别忘了标注数据来源为OpenStreetMap。查看法律问答了解更多。 |
你可以嵌入我们存在的地图,就像嵌入Google或Yahoo!地图一样。这使用下列JavaScript地图库之一可以被完成:
- Leaflet(leafletjs.com)是一个免费的开源JavaScript库,拥有轻量级且易用的API以及许多插件。
- OpenLayers(openlayers.org)是一个功能丰富的免费开源JavaScript库。
- Google Maps Example说明了如何使用Google地图API展示OSM地图。
这些也可用:
- Jawg Widgets([1])是由最先进的开源html/js组件集成的地图和服务(包括导航,地理编码等)。
- Mapstraction(mapstraction.com)is an open source javascript wrapper around the above libraries (and several others) allowing you to swap your choice of map library provider without re-coding anything.
- YCanvas(ycanvas.yoz.sk)为网页及移动端开发的Flash/AIR库。
- Zoom zoom zoom map拥有平滑缩放的特性。
- Khtmlib同样拥有平滑缩放特性。
- Ka-Map(ka-map.maptools.org)
- AFComponents UMap(umapper.com)可嵌入的Flash网络地图。
- OpenScales (openscales.org) mapping framework in ActionScript (flash), configurable by xml
- Modest Maps (modestmaps.com) in Actionscript3, Python, JavaScript, PHP, Processing, Cinder.
- Modestmaps-js is a lightweight, Javascript version of ModestMaps.
- Mapsui (github.com/pauldendulk/mapsui) a C# map component that accesses tile services through BruTile
- Polymaps (polymaps.org) JavaScript library from Stamen
在CMS/框架中嵌入OSM
你可以在你喜欢的内容管理系统(Content Management System, CMS)中嵌入OSM:
参见:
- Cartaro是一个用于在不同的CMS(特别是Drupal)中嵌入地图的框架。
瓦片源
![]() | It is highly recommend to contact the operators before using their servers! Respect their tile usage policy. |
OpenStreetMap瓦片服务器
Typically these examples show you how to use the OpenStreetMap tile servers. Your site serves up the HTML and the JavaScript (maybe) but the tile images of the map are still fetched by the browser from our servers. You must do this in accordance with the tile usage policy. The tile service comes with no guarantee as to availability or speed (if you expect particularly heavy demand, please contact the community to discuss your requirements first).
其他可选的瓦片服务器
其他可选的瓦片服务商(其使用条款可能与OSM不同)也可用。其中一些服务商将OSM数据与其自身拥有的图像结合,并且/或者应用了不同的地图颜色和风格。
一些瓦片服务商的列表,见Slippy map tilenames#Tile servers, TMS
自定义的瓦片
最最灵活的方法在这里!!OpenStreetMap同时向你提供了从我们的数据中生成自己独特的地图瓦片的能力,风格随你的偏好而定。
- 参见Switch2Osm.org以获得关于生成自己的瓦片的更多信息。