js 获取经纬度的实现方法

编程学习 2021-07-04 19:59www.dzhlxh.cn编程入门
狼蚁网站SEO优化长沙网络推广就为大家带来一篇js 获取经纬度的实现方法。长沙网络推广觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随长沙网络推广过来看看吧

js 获取经纬度的实现方法

<!-- 
 copyright (c) 2009 Google inc. 
 You are free to copy and use this sample. 
 License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license 
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> 
 <head> 
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 
  <title>Google Maps API Sample</title> 
  <style type="text/css"> 
   @import url("http://www.google.com/uds/css/gsearch.css"); 
   @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css"); 
  </style> 
  <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q" 
   type="text/javascript"></script> 
  <script src="http://www.google.com/uds/api?file=uds.js&v=1.0" type="text/javascript"></script> 
 
  <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script> 
  function initialize() { 
   if (GBrowserIsCompatible()) { 
    // Create and Center a Map36.1019825, 103.6055232) 
    var map = new GMap2(document.getElementById("map_canvas")); 
    map.setCenter(new GLatLng(36.1019825, 103.6055232), 13); 
    map.addControl(new GLargeMapControl()); 
    map.addControl(new GMapTypeControl()); 
   
    // bind a search control to the map, suppress result list 
    map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20))); 
     
   } 
  } 
  GSearch.setOnLoadCallback(initialize); 
 
  </script> 
 </head> 
 <body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;"> 
  <div id="map_canvas" style="width: 500px; height: 300px"></div> 
 </body> 
</html>

以上这篇js 获取经纬度的实现方法就是长沙网络推广分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持狼蚁SEO。

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板