google map地址解析
来源:互联网 发布:apache和nginx配合 编辑:程序博客网 时间:2024/05/17 04:58
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html;"/>
<title>Google Maps JavaScript API v3 Example: Geocoding Simple</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(31.23, 121.47);
var myOptions = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results[0].geometry.location);
//alert(results[0].geometry.location.jb);
map.setCenter(results[0].geometry.location);
this.marker = new google.maps.Marker({
title:address,
map: map,
position: results[0].geometry.location
});
var infowindow = new google.maps.InfoWindow({
content: '<strong>'+address+'</strong><br/>'+'纬度: '+results[0].geometry.location.jb+'<br/>经度: '+results[0].geometry.location.kb
});
infowindow.open(map,marker);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
</script>
</head>
<body onload="initialize()">
<div>
<input id="address" type="textbox" value="上海市">
<input type="button" value="地址解析" onclick="codeAddress()">
</div>
<div id="map_canvas" style="height:90%;top:30px"></div>
</body>
</html
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html;"/>
<title>Google Maps JavaScript API v3 Example: Geocoding Simple</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(31.23, 121.47);
var myOptions = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results[0].geometry.location);
//alert(results[0].geometry.location.jb);
map.setCenter(results[0].geometry.location);
this.marker = new google.maps.Marker({
title:address,
map: map,
position: results[0].geometry.location
});
var infowindow = new google.maps.InfoWindow({
content: '<strong>'+address+'</strong><br/>'+'纬度: '+results[0].geometry.location.jb+'<br/>经度: '+results[0].geometry.location.kb
});
infowindow.open(map,marker);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
</script>
</head>
<body onload="initialize()">
<div>
<input id="address" type="textbox" value="上海市">
<input type="button" value="地址解析" onclick="codeAddress()">
</div>
<div id="map_canvas" style="height:90%;top:30px"></div>
</body>
</html
- google map地址解析
- google map api 地址解析
- 利用Google Map解析中文地址
- google map 地址反向解析服务
- google Map API实现地址解析
- Java 调用Google Map Api解析地址,解析经纬度实例
- Java通过google map api实现地址解析的方法
- Geocoder google map地点搜索----地址及经纬度的解析
- 用 Google Map 的 Geocoder 接口来反向地址解析
- java如何利用google map api V3进行地址解析、反向地址解析
- google map 解析 经纬度
- 使用 PHP/MySQL 在google map中解析地址为经纬度
- Google Geocoding API(地址解析)
- Google Geocoding API(地址解析)
- 用Google Map API自动寻找地址
- google map系列教程的地址
- java google map 根据经纬度 获取地址
- google map系列教程的地址
- iPad充电器不能为iPhone充电吗?
- source insight 设置course new字体
- 《任正非正传》 赵凡禹 (这是一本拼凑的书,营养价值不大,仅供了解皮毛和吹水,而且书中有不少明显错误)
- C# Windows自带的MediaPlayer用法
- 重写TextBox重绘控件(转载)
- google map地址解析
- [unity基础教程]在Unity3D中动态创建对象和创建Prefab原型对象的三种方式
- 开启所有activex等Internet选项的批处理bat
- 飞思卡尔单片机DZ60---TPM1\TPM2溢出中断
- 关于ExtJS中的mask和unmask
- MOV 与 LDR区别
- JS导出table数据到excel问题-Automation 服务器不能创建对象
- 猜拳游戏
- 框架搭建之Struts框架搭建