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
Embedding OSM in a CMS/framework
You can embed OSM in your favourite content management system (CMS):
See also:
- Cartaro is a framework for embedding maps in different CMSes, especially Drupal.
Sources of tiles
It is highly recommend to contact the operators before using their servers! Respect their tile usage policy. |
OpenStreetMap tile servers
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).
Alternative tile servers
Alternative tile providers (with their own usage policies) are available. Some of them are combining OSM data with their own imagery and/or applying different colours and styles of map details.
See Slippy map tilenames#Tile servers, TMS for a list of some tile providers.
Your own map tiles
For ultimate flexibility, OpenStreetMap also gives you the unique ability to generate your own map tiles — styled any way you like — from our data.
- See Switch2Osm.org for more information on serving your own tiles.
- TileLauncher is a free out-of-the-box styled-tileserver for Amazon EC2. In a few clicks, choose your theme colours, your Amazon Instance type, your region, enter your credentials and press "Launch". [9]