【问题标题】:Mark in google maps a list of addresses - Android or PHP在谷歌地图中标记地址列表 - Android 或 PHP
【发布时间】:2017-03-04 16:39:48
【问题描述】:

我有一个地址列表,我想在谷歌地图中标记这些地方(将近 1k),也许可以获取它的坐标来保存它们。 实际上我不是在编写应用程序,但我知道两种语言(Android 和 PHP),我认为两者都可以做到这一点。任何想法 ?提前致谢!

【问题讨论】:

  • 如果你没有编程,那你为什么要问你的问题?
  • 我想在地图上看到它们标记
  • 好的,那么你应该展示一些你尝试过的东西。是的,这是可能的,但是您可以在其他地方搜索如何实现它

标签: android list google-maps gmsplace


【解决方案1】:

你试过google maps api吗?

https://developers.google.com/maps/documentation/geocoding/intro

https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding

我想这就是你要找的东西。

编辑:在地图上标记星星

    // In the following example, markers appear when the user clicks on the map.
// Each marker is labeled with a single alphabetical character.
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var labelIndex = 0;

function initialize() {
  var bangalore = { lat: 12.97, lng: 77.59 };
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 12,
    center: bangalore
  });

  // This event listener calls addMarker() when the map is clicked.
  google.maps.event.addListener(map, 'click', function(event) {
    addMarker(event.latLng, map);
  });

  // Add a marker at the center of the map.
  addMarker(bangalore, map);
}

// Adds a marker to the map.
function addMarker(location, map) {
  // Add the marker at the clicked location, and add the next-available label
  // from the array of alphabetical characters.
  var marker = new google.maps.Marker({
    position: location,
    label: labels[labelIndex++ % labels.length],
    map: map
  });

 }

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
  • 从现在开始我会这样做,但尽管如此,他只是要求一种方法来做到这一点,而不是特定的代码。如果他不提供任何代码,我不会为他编写代码,我只是参考了官方 api,他可以在其中找到方法。不过感谢您的建议。
  • 感谢 Enrique,这对我非常有用。我现在了解如何使用 php 发送多个地址并获取其位置。你知道我在哪里可以找到将所有这些标记到谷歌地图中的方法(用星星或类似的东西吗?)
  • 哦,我想我找到答案了,感谢 google developers.google.com/maps/documentation/javascript/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-29
  • 2013-07-22
  • 2015-09-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多