OpenStreetMap的:在网页中嵌入地图(如谷歌地图) [英] Openstreetmap: embedding map in webpage (like Google Maps)
问题描述
有没有一种方法嵌入/混搭在你的页面OpenStreetMap的(喜欢的方式谷歌地图API 作品)?
Is there a way to embed/mashup the OpenStreetMap in your page (like the way Google Maps API works)?
我要显示在地图我的一些标记页面内,并允许拖动/缩放身边,也许路由。
我怀疑会有一些这方面的Javascript API,但我似乎无法找到它。
I need to show a map inside my page with some markers and allow dragging/zooming around, maybe routing. I suspect there would be some Javascript API for this, but I can't seem to find it.
搜索得到我要访问原始地图数据的 API,但那似乎更在地图编辑;此外,与该工作将是一个AJAX任务繁重。
Searching gets me an API for access to raw map data, but that seems to be more for map editing; besides, working with that would be a heavy task for AJAX.
推荐答案
您需要使用一些JavaScript的东西,以显示您的地图。的OpenLayers是这样做的头号选择。
You need to use some JavaScript stuff to show your map. OpenLayers is the number one choice for this.
有在<一个例子href=\"http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example\">http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example在
<一个href=\"http://wiki.openstreetmap.org/wiki/OpenLayers_Marker\">http://wiki.openstreetmap.org/wiki/OpenLayers_Marker
和
<一个href=\"http://wiki.openstreetmap.org/wiki/Openlayers_POI_layer_example\">http://wiki.openstreetmap.org/wiki/Openlayers_POI_layer_example
这篇关于OpenStreetMap的:在网页中嵌入地图(如谷歌地图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!