在我的应用程序中,我集成了OpenStreetMap,并获取了起点和终点的坐标。我需要使用
在搜索了两天之后,我得到了这个
Intent
类将这些坐标传递给OpenStreetMap应用程序,因此我需要Uri
。在搜索了两天之后,我得到了这个
Uri
。
http://www.openstreetmap.org/?mlat=latitude&mlon=longitude&zoom=12
目前仅支持一个位置,但我不想要。有人能帮我吗?先感谢了...
以下是我的代码
Intent sendLocationToMap = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://openstreetmap.org/?mlat=13.074847&mlon=80.271019&zoom=12"));
startActivity(sendLocationToMap);
Intent sendLocationToMap = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://www.openstreetmap.org/directions?engine=osrm_car&route=%"+ sourceLatitude + "%" + sourceLongitude + destinationLatitude + "%" + destinationLongitude)); startActivity(sendLocationToMap);
但是它显示 "无法解析地理位置意图"http://www.openstreetmap.org/directions?engine=osrm_car&route=%13.06268%80.2653219%36427300%-99.27137000"**。 - Zakir Hussain