相关疑难解决方法(0)

Google Maps API V3:如何显示从A点到B点(蓝线)的方向?

我在数据库上有2个点的纬度和经度,我希望我的谷歌地图显示从A点到B点的路线......

就像我们在这里看到的那样(谷歌地图方向)

来自链接的图片

如何在地图上绘制方向线?

google-maps google-maps-api-3

72
推荐指数
5
解决办法
18万
查看次数

使用Google Maps API获取"未捕获的ReferenceError:谷歌未定义"错误

我正在尝试在地图上自定义标记,但我一直在"谷歌未定义".我尝试了不同的东西,但它仍然没有用.我在初始化地图之前使用了API密钥并包含了地图脚本.这是我的HTML:

 <html class="no-js" lang="en-US" >
        <head>
            <meta charset="UTF-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            <title>Home &#8211; Algebra</title>
    <link rel='dns-prefetch' href='//ajax.googleapis.com' />
    <link rel='dns-prefetch' href='//s.w.org' />
    <script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js?ver=2.1.0'></script>
    <link rel='https://api.w.org/' href='http://localhost/algebra/wp-json/' />
    <link rel="alternate" type="application/json+oembed" href="http://localhost/algebra/wp-json/oembed/1.0/embed?url=http%3A%2F%2Flocalhost%2Falgebra%2Fhome%2F" />
    <link rel="alternate" type="text/xml+oembed" href="http://localhost/algebra/wp-json/oembed/1.0/embed?url=http%3A%2F%2Flocalhost%2Falgebra%2Fhome%2F&#038;format=xml" />
        </head>
        <body class="page page-id-4 page-template page-template-page-templates page-template-page-home page-template-page-templatespage-home-php logged-in offcanvas">



    <header id="masthead" class="site-header" role="banner">
        <div class="top-strip"></div>
        <div class="top-nav"></div>
    </header>

    <section class="container">
<section class="map">
    <div id="map-container"></div>
  <div class="contact-container">
    <div class="contact">
      <img src="" alt="mail-icon">
      <span>You can contact us at info@algebraventures.com</span> …
Run Code Online (Sandbox Code Playgroud)

html javascript google-maps

3
推荐指数
1
解决办法
6806
查看次数

标签 统计

google-maps ×2

google-maps-api-3 ×1

html ×1

javascript ×1