小编Art*_*eam的帖子

如何在Google Maps API v3中使用Maps URL查询?

我有html页面(www.mywebsite / index),上面有JavaScript google maps api实现。所以我很想知道是否有任何方法可以在Google地图上使用https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393这样的查询,但是在我的页面上却没有仅映射,但也包含其他元素。因此,我正在寻找一种在页面上进行查询的方法,也许通过php在页面加载之前直接将信息提供给地图。

现在的索引代码是这样的:

    <!DOCTYPE html>
    <html lang="en">
    <head>
     <meta charset="UTF-8">
     <meta name="viewport" content=" width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <style>
      #map{
        height:900px;
      }
    #html,body{
    height: 100%;
        margin: 0;
        padding: 0;}

    #floating-panel {
        position: absolute;
        top: 10px;
        left: 8%;
        z-index: 5;
        background-color: #fff;
        padding: 5px;
        border: 1px solid #999;
        text-align: center;
        font-family: 'Roboto','sans-serif';
        line-height: 30px;
        padding-left: 10px;
      } 
    <style>
      #map{
        height:900px;
      }
    #html,body{
    height: 100%;
        margin: 0;
        padding: 0;}

    #floating-panel {
        position: absolute;
        top: 10px;
        left: …
Run Code Online (Sandbox Code Playgroud)

javascript url google-maps-api-3 google-maps-urls

0
推荐指数
1
解决办法
479
查看次数