<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>百度地图API文档学习</title>
<script src="http://api.map.baidu.com/api?v=2.0&ak=G9uEYYOyOqUyYeSEhoZzPvsGGPIKFdNa"></script>
<script src="../jquery.js"></script>
<style>
*{padding:0;margin:0;}
html,body{height: 100%;}
#container{width: 100%;height:50%;}
.choice{
margin-top:10px;
}
.choice:after{
display: block;
content: "";
height: 0;
width: 0;
clear: both;
}
.choice ul{
list-style: none;
width: 100%;
}
.choice ul li{
display: inline-block;
background:#999;
padding:5px;
text-align: center;
color: white;
float: left;
width: 20%;
margin-left: 10%;
box-sizing:border-box;
}
.choice .select{
background: #888;
color: red;
}
.navtrans-view.expand a{
display: none;
}
</style>
</head>
<body>
<div id="container"></div>
<div id="log"></div>
<script>
//创建地图函数
var map;
var currentX,currentY;
function ininMap(){
map=new BMap.Map("container"); //创建一个地图实例,HTML容器包含地图
var point=new BMap.Point(110.404,39.915);
map.centerAndZoom(point,10);
map.enableScrollWheelZoom();
map.addControl(new BMap.GeolocationControl()); // 定位控件
var geolocation = new BMap.Geolocation(); //百度包装好的定位库
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
map.panTo(r.point);
currentX=r.point.lng;
currentY=r.point.lat;
console.log('您的位置:'+r.point.lng+','+r.point.lat);
addInfo();
}
else {
alert('failed'+this.getStatus());
}
},{enableHighAccuracy: true});
}
ininMap();
//为多个点添加窗口信息
function addInfo(){
var data_info = [
[116.417854,39.921988,"地址:北京市东城区王府井大街88号乐天银泰百货八层"],
[116.406605,39.921585,"地址:北京市东城区东华门大街"],
[116.412222,39.912345,"地址:北京市东城区正义路甲5号"],
[116.479128,39.914908,"地址:北京市朝阳区建国路93号院万达广场A座新世界彩旋百货F1层"],
[currentX,currentY,"您处于:北京市海淀区马甸东路金澳国际公寓1111号"]
];
console.log(data_info.length+"/"+currentY+"/"+currentY);
var opts = {
width : 250, // 信息窗口宽度
height: 80, // 信息窗口高度
title : "位置信息" , // 信息窗口标题
enableMessage:true//设置允许信息窗发送短息
};
for(var i=0;i<data_info.length;i++){
var marker = new BMap.Marker(new BMap.Point(data_info[i][0],data_info[i][1])); // 创建标注
var content = data_info[i][2];
map.addOverlay(marker); // 将标注添加到地图中
addClickHandler(content,marker);
}
function addClickHandler(content,marker){
marker.addEventListener("click",function(e){
openInfo(content,e)}
);
}
function openInfo(content,e){
var p = e.target;
var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
var infoWindow = new BMap.InfoWindow(content,opts); // 创建信息窗口对象
map.openInfoWindow(infoWindow,point); //开启信息窗口
}
}
</script>
</body>
</html>相关推荐
拆解一个800G光模块:手把手带你认识里面的MT插芯和光纤阵列(FA)
本文详细拆解了800G光模块中的关键组件MT插芯和光纤阵列(FA),揭示了并行光学技术如何实现高速数据传输。通过显微镜下的精密观察,展示了MT插芯的高精度构造和光纤阵列的连接奥秘,同时解析了高精度研磨工艺对光信号传输的重要性。这些微型组件是高速收发模块实现800Gbps带宽的核心技术。
百度地图API-自定义图标覆盖物
地图覆盖物 Overlay:覆盖物的抽象基类,所有的覆盖物均继承此类的方法。 Marker:标注表示地图上的点,可自定义标注的图标。 Label:表示地图上的文本标注,您可以自定义标注的文本内容。 Polyline:表示地图上的折线。 Polygon:表示地图上的多边形。多边形类似于闭合的折线,另外您也可以为其添加填充颜色。 Circle: 表示地图上的圆。 InfoWindow:信...
SpringBoot整合oceanbase,实现oracle无缝切换到oceanbase
随着去“IOE”化的潮流,近些年来,许多与国家相关的项目不约而同到地往”国产化“方向靠拢,不可避免地,一些项目可能需要进行数据库迁移。
百度地图API-覆盖物
百度地图API-覆盖物
STC8H单片机ADC实战:从读取电位器到串口绘图,12位精度玩起来
本文详细介绍了STC8H单片机的ADC功能实战应用,从读取电位器到串口绘图,展示了12位精度的实现方法。通过硬件连接、代码配置、串口数据传输及高级优化技巧,帮助开发者快速掌握ADC模块的使用,适用于各种传感器数据采集和信号处理场景。
3D打印必备:如何用Blender将NWD文件转成STL(附精度调整技巧)
本文详细介绍了如何使用Blender将NWD文件转换为STL格式,特别针对3D打印需求提供了精度调整技巧。从环境准备到分步转换流程,再到3D打印专属优化策略,帮助设计师解决破面、尺寸偏差等常见问题,实现高效、精准的格式转换。
vue中使用百度地图自定义信息窗口
vue项目中通过百度地图API实现自定义信息窗口(通过infoBox实现自定义信息窗口)
S4 HANA 1809+折旧过账(AFAB/AFABN)凭证行数据存储逻辑变迁:从BSEG到ACDOCA的深度解析
本文深度解析了S4 HANA 1809+版本中折旧过账(AFAB/AFABN)凭证行数据存储逻辑的变迁,从传统的BSEG表迁移到ACDOCA表。文章详细探讨了这一变更的技术背景、官方设计意图及实际影响,包括数据存储量减小和系统性能提升等优势。同时提供了升级项目的应对策略和最佳实践建议,帮助用户顺利过渡到新的数据存储模型。
百度地图 ( 二 ) 添加覆盖物
百度地图 ( 二 ) 添加覆盖物
微信DAT图片解密全攻略:一键转换JPG/PNG/GIF
本文详细解析了微信电脑版中DAT图片的加密原理与存储路径,并提供了从定位文件到使用专业工具进行一键解密的完整操作指南。通过简单的步骤,用户可将加密的DAT文件无损还原为JPG、PNG或GIF格式,有效解决无法直接查看聊天图片的难题,同时兼顾了隐私清理与磁盘空间管理。
微信小程序 - 最新详细实现用户保存下载视频到手机相册,将视频临时路径、在线播放地址(网络路径)URL存储到手机,弹出访问手机相册权限询问,支持视频格式mp4、avi、mov、wmv、flv、webm
微信小程序,视频,手机相册,保存,另存为,小程序保存到相册权限,writePhotosAlbum,一键保存视频到手机相册功能(视频来源为链接),第一次要获取用户授权,授权使用相册权限,小程序视频下载,如何把视频下载到相册,下载一个视频到本地相册,显示下载进度,可取消下载,视频下载到本地,微信小程序视频如何下载,保存视频到相机,页面播放视频并下载到本地,安卓系统,苹果ios保存到相册报错,权限拒绝后打不开,添加相册授权弹框拒绝后再也出不来了,实现保存视频到手机相册功能,将mp4在线视频下载并存储到用户的手机中
百度地图的覆盖物自定义(三)--自定义搜索结果+标注+覆盖物
百度地图的覆盖物自定义(三)--自定义搜索结果+标注+覆盖物 需求分析,首先要将搜索的结果使用自定义的标注+完全自定义的信息窗口(前一篇已经说了),然后点击某个标注,标注icon变换,同时提示的自定义窗口样式也需要进行相应的变化。其中最大的麻烦是,点击后需要变换的样式,并且前一个被点击的标注物和信息窗口需要还原 三张图表示其中的过程 1搜索,标注所有结果并在上面显示相应的信息提示窗口
C语言使用开源库libusb进行USB设备操作
https://libusb.info/libusb is a C library that provides generic access to USB devices. It is intended to be used by developers to facilitate the production of applications that communicate with USB hardware. It is portable: Using a single cross-platform AP
百度地图使用的详细教程
百度地图API是一套为开发者提供的基于百度地图的应用程序接口,包括JavaScript、iOS、Andriod、静态地图、Web服务等多种版本,提供基本地 图、位置搜索、周边搜索、公交驾车导航、定位服务、地理编码等功能。百度地图API的官网是百度地图使用之前需要注册成为开发者,根据提示进行实名认证,注册成功即可。 注册成功之后,打开控制台,进入应用管理,输入应用名称,类型,白名单写英文半角的*。 创建成功,显示下图,会显示密钥AK创建一个地图之后,添加比例尺控件,缩放控件,城市列表控件 所有叠加或覆盖到地图
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
汉书HE8,好用的汇编代码编写工具
汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大
百度地图API使用Example I
百度地图APIsh
WINCC7.3破解文件
WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!
百度地图API学习(01):基本入门指南
目录 一、基本知识 1.1 使用移动端显示代码 1.2 必备工具 2 最简单的百度地图对象创建过程 2.1 html主题元素的定义 2.2 地图对象脚本的定义 3 定位点覆盖物及标记设置 3.1 基本函数说明 3.1.1 BMap.Marker函数 3.1.2 BMap.Label函数 3.1.3 BMap:Icon函数 3.2 不带标签标记实现步骤: 3.3 自定义图标...
ET2012新版免狗免安装绿色软件
ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,
前端关于百度地图JavaScript Api 使用
百度地图的用法以及一些小案例
HTML新特性【账号和获取密钥、初始化、变更地图类型、添加控件、改变控件位置、添加覆盖物、自定义标注图标、添加文本标注】(四)-全面详解(学习总结---从入门到深化)
HTML新特性【账号和获取密钥、初始化、变更地图类型、添加控件、改变控件位置、添加覆盖物、自定义标注图标、添加文本标注】(四)-全面详解(学习总结---从入门到深化)
MVC项目中使用百度地图
已经很久没更新博客了,因为最近一直在学习前端的知识,没那么多时间,写博客或者写文章不但没有钱,写得好还好说,如果写得不好,一些吃瓜群众,不仅要喷你,搞不好还要人身攻击就不好了。所以写博客的人,脸皮得厚,像我这样,任凭骂我千百遍,我依旧坚持写,也不怕侮辱了谁的眼睛,哈哈~我发现有些做技术比较厉害的人,多少都有些脾气,你永远不知道他什么时候突然就消失在园子里了...... 在使用百度地图之前,
javascript百度地图接口开发
javascript百度地图接口开发 最近在用laravel框架仿写饿了么外卖商城,于是学习了一下有关地图接口相关的知识,以下是百步地图接口开发文档的一些类和方法的使用.... JavaScript API v2.0介绍 百度地图JavaScript API是一套由JavaScript语言编写的应用程序接口,它能够帮助您在网站中构建功能丰富、交互性强的地图应用,包含了构建地图基本功能的各种接
百度地图API学习总结
一、百度地图API介绍 百度地图API是可以给开发人员调用的开放API,我们可以用Javascript语言进行调用; 听起来API这个概念很抽象,初学者想:“百度的API,我们怎么能调用?”,其实不是这样,我们通过一个URL地址进行引用,然后就可以调用他的API; 不需要Web服务器,只需要一个浏览器就能够使用百度地图API; 二、调用API的基本文件格式 以下为开发百度...
1546



被折叠的 条评论
为什么被折叠?



