OpenLayers添加和删除控件
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>添加和删除控件</title> <link rel="stylesheet" href="./OpenLayers-2.12/theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="./css/style.css" type="text/css"> <style>
/* round corners of layer switcher, and make it transparent */
.olControlLayerSwitcher .layersDiv {
border-radius: 10px 0 0 10px;
opacity: 0.75;
filter: alpha(opacity=75);
}
</style> <script src="./OpenLayers-2.12/lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map('map', {
controls: [ new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.Permalink('permalink'),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults()
],
numZoomLevels: 6 }); var ol_wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}
); var gwc = new OpenLayers.Layer.WMS(
"Global Imagery",
"http://maps.opengeo.org/geowebcache/service/wms",
{layers: "bluemarble"},
{tileOrigin: new OpenLayers.LonLat(-180, -90)}
);
var dm_wms = new OpenLayers.Layer.WMS(
"DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png"},
{visibility: false}
); map.addLayers([ol_wms, gwc, dm_wms]); if (!map.getCenter()) {
map.zoomToMaxExtent();
}
}
</script>
</head>
<body onload="init()">
<div id="tags">
control, basic
</div>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
</html>
OpenLayers添加和删除控件的更多相关文章
- WPF 中动态创建、删除控件,注册控件名字,根据名字查找控件
动态创建控件 1.容器控件.RegisterName("Name",要注册的控件) //注册控件 2.容器控件.FindName("Name") as 控 ...
- wpf动态增加删除控件
我在xaml中定义了一个名字为morepictureWrapPan为WrapPanel,然后将控件添加在此WrapPanel中.由于要实现控件的删除功能,所以增加的textbox和button的名字都 ...
- OpenLayers 3 之 地图控件(control)
OpenLayers 3 之 地图控件(control) 地图控件(control)是指地图上比例尺,缩略图,拉近拉远的按钮,滚动控制条等控件,默认控件有三个,可以禁用. OpenLayers 3 之 ...
- WPF 中动态创建和删除控件
原文:WPF 中动态创建和删除控件 动态创建控件 1.容器控件.RegisterName("Name",要注册的控件) //注册控件 2.容器控件.FindName(" ...
- 百度地图API示例之添加定位相关控件
代码 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" cont ...
- C#构架之基础学习----动态添加窗体和 控件
仿照窗体应用程序编写: 任务一:生成一个Form类的窗体对象frm using System.Windows.Forms; //using指令使用Form对象创建所需的命名空间 //如 ...
- 在WPF中添加Windows Form控件(包括 ocx控件)
首先,需要向项目中的reference添加两个dll,一个是.NET库中的System.Windows.Forms,另外一个是WindowsFormsIntegration,它的位置一般是在C:\ ...
- IOS 当一个控件被添加到父控件中会调用(didMoveToSuperview)
/** * 当一个控件被添加到父控件中就会调用 */ - (void)didMoveToSuperview { if (self.group.opened) { self.nameView.image ...
- Add an Item to the Navigation Control 将项目添加到导航控件
In this lesson, you will learn how to add an item to the navigation control. For this purpose, the N ...
随机推荐
- <每日一题>题目24:冒泡排序
''' 冒泡排序:比较相邻元素,顺序错误就交换顺序 ''' import random import cProfile def bubble_Sort(nums): for i in range(le ...
- mahout in Action2.2-给用户推荐图书(3)-评价推荐系统
推荐系统引擎是一个工具,一种回答问题的手段,"对用户来讲什么是最好的推荐?",在研究回答的前先研究一下这个问题.一个好的推荐的准确含义是什么?如何知道推荐系统是如何生成推荐的?下面 ...
- [欧拉路]CF1152E Neko and Flashback
1152E - Neko and Flashback 题意:对于长为n的序列c和长为n - 1的排列p,我们可以按照如下方法得到长为n - 1的序列a,b,a',b'. ai = min(ci, ci ...
- Ionic 微信支付
1.安装插件 ionic plugin add https://github.com/mrwutong/cordova-qdc-wxpay.git 2.代码 controller.js angular ...
- Django项目:CRM(客户关系管理系统)--81--71PerfectCRM实现CRM项目首页
{#portal.html#} {## ————————46PerfectCRM实现登陆后页面才能访问————————#} {#{% extends 'king_admin/table_index.h ...
- leyou_01_自定义异常处理器
1.自定义异常处理器,当程序发生异常时可以我们可以自己定义返回的,状态码和状态信息 2.当异常发生时调用我们的自定义异常 @RestController @RequestMapping("i ...
- 再谈MFC学习——模态对话框的数据传递
学习c++的目的就是为了使用封装好的类.而最最经典的封装类当然是微软的MFC窗体程序类. 学习MFC编程之前要学习c++的主要知识,掌握c++的基本编程思想. 以下就看下我学习的MFC模态对话框的数据 ...
- POJ 1386&&HDU 1116 Play on Words(我以后再也不用cin啦!!!)
Play on Words Some of the secret doors contain a very interesting word puzzle. The team of archaeolo ...
- spring源码学习之AOP(一)
继续源码学习,看了spring中基础的容器和AOP感觉自己也没有什么长进,哈哈,我也不知道到底有用没有,这可能是培养自己的一种精神吧,不管那么多,继续学习!AOP中 AOP中几个重要的概念:(1)Ad ...
- 技术人自己的KPI
为什么需要技术KPI 在业务技术团队,有一个不好的趋势,就是团队越来越业务,越来越没有技术味道.每个人都在谈业务,技术大会上在谈业务,周会上在聊业务,周报里写的是业务项目......唯独少被谈及的是技 ...