当前位置: 首页 > news >正文

网站建设平台多少钱淘宝seo搜索优化工具

网站建设平台多少钱,淘宝seo搜索优化工具,asp 建站,龙华网站建设销售员使用Google Maps API在网页中显示地图和标记的示例博客。以下是一个简单的示例: C:\pythoncode\blog\google-map-markers-gh-pages\google-map-markers-gh-pages\index.html 介绍: 在本篇博客中,我们将学习如何使用Google Maps API在网页中…

使用Google Maps API在网页中显示地图和标记的示例博客。以下是一个简单的示例:
C:\pythoncode\blog\google-map-markers-gh-pages\google-map-markers-gh-pages\index.html
在这里插入图片描述

介绍:

在本篇博客中,我们将学习如何使用Google Maps API在网页中显示地图,并在地图上添加标记。Google Maps API提供了丰富的功能和灵活性,使我们可以在网页中集成地图和地理信息。

步骤:

  • 创建一个新的HTML文件,并将以下代码保存为index.html
 <!DOCTYPE html>
<html><head><title>Map with Markers and Info Windows</title><meta name="viewport" content="initial-scale=1.0"><meta charset="utf-8"><style>/* Always set the map height explicitly to define the size of the div* element that contains the map. */#map {height: 100%;}/* Optional: Makes the sample page fill the window. */html, body {height: 100%;margin: 0;padding: 0;}</style></head><body><div id="map"></div><script>var poly;
var map;function initMap() {map = new google.maps.Map(document.getElementById('map'), {zoom: 7,center: {lat: 41.879, lng: -87.624}  // Center the map on Chicago, USA.});poly = new google.maps.Polyline({strokeColor: '#000000',strokeOpacity: 1.0,strokeWeight: 3});poly.setMap(map);// Add a listener for the click eventmap.addListener('click', addLatLng);
}// Handles click events on a map, and adds a new point to the Polyline.
function addLatLng(event) {var path = poly.getPath();// Because path is an MVCArray, we can simply append a new coordinate// and it will automatically appear.path.push(event.latLng);// Add a new marker at the new plotted point on the polyline.var marker = new google.maps.Marker({position: event.latLng,title: '#' + path.getLength(),map: map});
}</script><script src="https://cdn.jsdelivr.net/gh/somanchiu/Keyless-Google-Maps-API@v5.9/mapsJavaScriptAPI.js"></script></body>
</html>

请在页面源代码中加入 <script src="https://cdn.jsdelivr.net/gh/somanchiu/Keyless-Google-Maps-API@v5.9/mapsJavaScriptAPI.js">。确保你无需输入Maps JavaScript API,也可使用Google地图服务。

  • 在浏览器中打开index.html文件,你会看到一个地图显示在页面上,并且有一个标记在地图上显示出来。

总结:

在本篇博客中,我们学习了如何使用Google Maps API在网页中显示地图,并添加标记。通过使用Google Maps API和一些简单的JavaScript代码,我们可以轻松地集成地图和地理信息到我们的网页中。

参考

https://github.com/somanchiu/Keyless-Google-Maps-API/tree/master
http://www.noobyard.com/article/p-txwklxur-bm.html

http://www.zhongyajixie.com/news/15225.html

相关文章:

  • 如何创办一个赚钱的网站个人发布信息的免费平台
  • 苏州web网站建设windows优化大师有用吗
  • 源码怎么做网站保定百度推广优化排名
  • 微网站怎么样做线下活动吸粉万网创始人
  • 网站建设案例资料东莞seo排名收费
  • 网站建设商家公司外贸推广建站
  • 免费的发帖收录网站手机推广软文
  • 仿克米设计网站产品经理培训哪个机构好
  • 建设网站的题目抖音关键词搜索排名收费
  • 怎么做情侣网站品牌网络推广
  • qq互联 网站建设不完善微信管理系统软件
  • 网站建设 cnseo招聘信息
  • 网站制作的步骤不包括河源市企业网站seo价格
  • Oss怎么做静态网站如何做宣传推广效果最好
  • 网站集约化建设讲话稿百度首页排名优化价格
  • 徐州手机网站制作公司网络营销案例ppt
  • 常州做网站要多少钱优化大师手机版下载
  • 武汉的电商网站设计360广告推广平台
  • wap网站建设公司网络广告的收费模式有哪些
  • 移动网站 制作任何小说都能搜到的软件
  • 阿拉伯语网站怎么做优化大师官网登录入口
  • 怎么做报名网站湖南关键词优化排名推广
  • 上海中学门户网站登陆百度关键词推广多少钱
  • 政府网站信息内容建设不百度推广时间段在哪里设置
  • 阿里云服务器做盗版视频网站搜索引擎都有哪些
  • 有什么好的互联网平台做网站如何让百度快速收录网站文章
  • 西安做网站公司玖佰网络百度账号登录个人中心
  • 做外汇网站免费友链互换
  • 多语言网站建设 技术网络营销专家
  • 网站的推广优化西安网站制作推广