Zh-hans:Deploying your own Slippy Map

From OpenStreetMap Wiki
Jump to navigation Jump to search

部署网络地图使用OSM地图的通常办法。通常这意味着使用一些JavaScript代码整合一张展示地图瓦片网络地图到你的网页上。

你可以嵌入我们存在的地图,就像嵌入Google或Yahoo!地图一样。这使用下列JavaScript地图库之一可以被完成:

这些也可用:

Embedding OSM in a CMS/framework

You can embed OSM in your favourite content management system (CMS):

CMS/framework Module/plugin Note Sources Tutorial Example
with OSM map embedded
CMS Made Simple Osm Tag Module based on OpenLayers GitHub Documentation in manpage
CMS Made Simple Leaflet Tag Module based on Leaflet GitHub Documentation in manpage
Django GeoDjango A world-class geographic web framework Included in the Django framework A world-class geographic web framework geodjango-basic-apps
Django OSMEditor old! from year 2009 [2] Editors/Django#Installation
Django-CMS django-cms-osm [3] [4]
Drupal DrupalMappingKit Collection of Drupal modules to support custom mapping [5] Drupal tutorial from MapBox MapBox
Drupal Leaflet module Leaflet module
Drupal OpenLayers module OpenLayers module
Joomla injooosm
Joomla OSModul Module based on Leaflet and supports markers [6]
Java Server Faces JSF2Leaf Powered by Leaflet
Mediawiki MultiMaps Uses Leaflet or Google Maps API (configurable) Wikimedia Gerrit This wiki! In the tutorial
MediaWiki Simple image Depends on a reliable map image provider like StaticMapLite used to be This wiki!
MediaWiki Slippy Map Powered by OpenLayers This wiki! This wiki!
MediaWiki Kartographer Powered by Leaflet MediaWiki wiki Wikivoyage
MediaWiki Maps Powered by OpenLayers Manual
MediaWiki Semantic Maps Requires Semantic MediaWiki Manual
MoinMoin moinmoinosm Macro for MoinMoin [7] [8] Flisol
Novius OS Ounziw OSM iframe style OSM map GitHub
Tiki Wiki CMS Groupware built-in Via OpenLayers
WordPress OSM WordPress Plugin Also adds gpx and kml files Download Simple sample

See also:

  • Cartaro is a framework for embedding maps in different CMSes, especially Drupal.

Sources of tiles


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]