【问题标题】:Pinpoint location (latitude & longitude) in Google Maps在 Google 地图中精确定位(纬度和经度)
【发布时间】:2013-10-09 14:52:42
【问题描述】:

我有一个位置的纬度和经度数据。我想在我的应用程序中将其显示到地图中。我计划使用谷歌地图向用户显示这个位置。

为此,我需要 Google Maps API 吗?还是谷歌地图坐标? 我查看了他们的网站,但所有这些品种都让我感到困惑。 我只需要将数据(纬度和经度)显示为可视化(地图),以使我的应用程序更加用户友好。

我之前没用过Google Maps API,有经验的请指导一下。

谷歌地图 API:http://www.google.com/enterprise/mapsearth/products/mapsapi.html#

谷歌地图坐标:http://www.google.com/enterprise/mapsearth/products/coordinate.html?rd=1#

附带说明,我可能会出售应用程序(使用订阅),因此我需要 Google Maps API 许可证。谁知道多少钱,流程是怎样的? (例如,按月或按年、按用户或按使用等)

编辑

或者还有其他用于映射的 API 吗?类似于 Google Maps API。

【问题讨论】:

  • This 应该会有所帮助。
  • 是的,这看起来像我需要的。根据要显示给用户的纬度和经度标记位置。所以这是在使用 Google Maps API?
  • 如果您只是想显示地图,则可以使用Static Maps API
  • 静态地图可以放入标记吗?会有很多标记,而且标记是动态的。

标签: google-maps google-maps-api-3 geolocation location


【解决方案1】:

我们必须给出纬度和经度。

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
    window.onload = function () {
        var mapOptions = {
            //give latitude and long
            center: new google.maps.LatLng("18.9750", "72.8258"),
            zoom: 8,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var infoWindow = new google.maps.InfoWindow();
        var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
            //give latitude and long
        var myLatlng = new google.maps.LatLng("18.9750", "72.8258");
        var marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            title: "Mumbai"
        });
    }
</script>

<div id="dvMap" style="width: 500px; height: 500px">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-31
    • 2015-09-07
    • 1970-01-01
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    相关资源
    最近更新 更多