php 调用google api 地图显示代码
google.load("maps", "2.x");
google.setOnLoadCallback(initialize);
var map = null;
var geocoder = null;
function initialize() {
// 检测IE是否支持 Google Map API
if ( GBrowserIsCompatible() ) {
map = new google.maps.Map2(document.getElementById('map'));
geocoder = new GClientGeocoder();
// 设置地图中心
map.setCenter(new GLatLng(25.036772,121.520269), 12);
} // if
else {
alert('您流量器不支持Google Map');
} // else
}
function showLocation() {
// 清除marker
map.clearOverlays();
var address = document.getElementById('txtAddress').value;
geocoder.getLocations(address, cb_showLocation);
}
function cb_showLocation(result) {
// 显示结果
if (result.Status.code == G_GEO_SUCCESS) {
// 成功
for (var i=0; i
// lat
var lng = result.Placemark[i].Point.coordinates[0];
// lng
var address = result.Placemark[i].address; // 地址
var point = new GLatLng(lat,lng);
var marker=new GMarker(point, {title:i+1});;
map.addOverlay(marker);
} // for
} // if
}
var status=[];
status[G_GEO_SUCCESS] = "Success";
status[G_GEO_MISSING_ADDRESS] = "Missing Address";
status[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address";
status[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address";
status[G_GEO_BAD_KEY] = "Bad Key";
status[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries";
status[G_GEO_SERVER_ERROR] = "Server Error";

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

WebStorm Mac版
好用的JavaScript开发工具

禅工作室 13.0.1
功能强大的PHP集成开发环境

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中