简体   繁体   English

使用带有标记的openstreet地图和带有javascript的折线

[英]using openstreet maps with marker and polylines with javascript

Guys i am complete newbie in using openstreetmaps.i know how to use google and bing maps api.伙计们,我是使用 openstreetmaps 的新手。我知道如何使用 google 和 bing 地图 api。 my requirement is to create a sample map with just some markers to locate and draw poly lines between them.i have read the api but couldnt find it how to use.this is used in a commercial application.i need pointers and sample code.please help me out.我的要求是创建一个示例 map,只有一些标记来定位和绘制它们之间的折线。我已经阅读了 api 但找不到它如何使用。这用于商业应用程序。我需要指针和示例代码。请帮帮我。

take a look at either openlayers (what OSM use on their pages):看看任何一个 openlayers(OSM 在他们的页面上使用什么):

http://dev.openlayers.org/releases/OpenLayers-2.10/examples/ http://dev.openlayers.org/releases/OpenLayers-2.10/examples/

Or Cloudmades new http://leaflet.cloudmade.com/ api或 Cloudmades 新http://leaflet.cloudmade.com/ api

both of these can show open street map data这两个都可以显示开放街道 map 数据

I have done this.我已经做到了。 you can do it very easily with openstreetmap.org, Use this following API http://leaflet.cloudmade.com/index.html您可以使用 openstreetmap.org 轻松完成,使用以下 API http://leaflet.cloudmade.com/index.html

i recommend that you use a pre-rendered KML input file.我建议您使用预渲染的 KML 输入文件。 this example shows you how to do that on OSM:此示例向您展示如何在 OSM 上执行此操作:

http://maps.burningsilicon.net http://maps.burningsilicon.net

place a link to your KML file on the bottom textbox.在底部文本框中放置一个指向您的 KML 文件的链接。

you might want to check out PHP KML parser examples, if you want to create files on the fly from a MySQL database (or from a csv-style textfile).如果您想从 MySQL 数据库(或从 csv 样式的文本文件)动态创建文件,您可能需要查看 PHP KML 解析器示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM