zoukankan
html css js c++ java
Jquery 的google map 应用
<script language="javascript" type="text/javascript"> $(document).ready(function () { $.ajax({ type: "POST", url: "GetMap.ashx/ProcessRequest", dataType: "json", success: function (data) { var datalist = data; var map = new GMap2(document.getElementById("mapdiv")); //地图信息 map.addControl(new GMapTypeControl()); //选择地图类型的控件(如卫星图到二维地图的切换控件) map.addControl(new GLargeMapControl()); //大号平移和缩放控件,位置是左上角 map.addControl(new GOverviewMapControl()); //添加鹰眼控件 map.addControl(new GScaleControl()); // 比例尺控件 map.enableGoogleBar(); //显示google搜索框 var icon = new GIcon(); //设置ICO定位 icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); //图片尺寸 icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); $(datalist).each(function (index, content) { map.setCenter(new GLatLng(content.LATITUDE, content.LONGITUDE), 13); //设置显示地图中间位置,代表地图缩放级别 var point = new GLatLng(content.LATITUDE, content.LONGITUDE); //组合坐标点 map.addOverlay(createMarker(point, content.ADDRESS)); //注册坐标点 }) window.setTimeout(function () { //等待2秒,然后平移到一个新的中心点 map.panTo(new GLatLng(content.LATITUDE, content.LONGITUDE)); }, 2000); }, error: function (data) { alert('获取数据超时...'); } }); //显示信息函数 function createMarker(point, number) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function () { marker.openInfoWindowHtml("<b>" + number + "</b>"); }); return marker; } }) </script>
查看全文
相关阅读:
Mysql第八天 分区与分表
ios—项目开发需求文档
spark资料下载
网络爬虫:使用多线程爬取网页链接
调用微信高级群发接口--视频群发接口出问题(微信官方文档错误纠正)
享元模式
在JAVA中怎样跳出当前的多重嵌套循环?
获取个人借阅信息---图书馆client
IOS 以随意点为圆心 旋转UIView
ESP8266学习笔记4:ESP8266的SmartConfig
原文地址:https://www.cnblogs.com/javawebsoa/p/2458196.html
最新文章
Android之Adapter用法总结
android专栏
Android应用开发基础篇(1)-----Button
Android应用开发基础篇(2)-----Notification(状态栏通知)
Android应用开发基础篇(3)-----ListView
Android应用开发基础篇(4)-----TabHost(选项卡)
Android应用开发基础篇(14)-----自定义标题栏
{head first} --- networking 3
Image与byte[]数组的相互转换
HttpClient 发送 HTTP、HTTPS 请求的简单封装
热门文章
Scala学习之爬豆瓣电影
Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.3
leetcode: Maximum Depth of Binary Tree
价值1400美元的CEH(道德黑客)认证培训课程长啥样?(3)工具集
Oracle-02-数据库概述
学习MongoDB 一:MongoDB 入门(安装与配置)
mongodb官网文档阅读笔记:write concern
12.4.1 压缩索引
【java】itoo项目实战之大数据查询之使用 new map 优化hibernate之级联查询
Java 位运算符 深入理解
Copyright © 2011-2022 走看看