1,视口坐标的原点在左上角,水平向右为x轴正向,垂直向下为y 轴正向;
2,地图坐标原点为初始图层的中心点,水平向右为x轴正向,垂直向上为y轴正向;
3,视口中心点永远与地图中心点重合,不一定与瓦片中心点重合;
4,拖动图层的逻辑描述:地图是不动的,视口移动从而展示不同的地图区域; 
Resolution:解析度 = 地图尺寸/视口尺寸好比摄像机,镜头拉得越近解析度越小,地图看得越清晰。 
map.calculateBounds():地图当前被查看区域边界
map.centerLayerContainer():设置图层的左和上边距,保证图层中心点与地图中心点重合
map.getCenter():地图中心点坐标(地图坐标,经纬度)
map.getCurrentSize():取视口尺寸
map.getExtent():地图当前欲被查看区域;地图中心所在区域(经纬度)、视口尺寸乘以解析度
map.getLonLatFromViewPortPx():视口坐标转地图坐标
map.getMaxExtent():地图最大可被查看区域(经纬度),视口中心点不可以移出该区域
map.getResolution():地图当前解析度
map.getSize():视口尺寸
map.getViewPortPxFromLonLat():地图坐标转成视口坐标
map.getZoom():当前缩放级别
map.pan(x轴方向, y轴方向, options):移动地图map.setCenter(新的地图中心点, 缩放级别, 拖动, 强制缩放级别改变):重新设置地图中心、缩放比例  
openlayers加载过程
map = new OpenLayers.Map('map');
1,   创建map对象,参数为展示地图的Dom元素的id
a)        定义tileSize(默认256*256)
b)        定义maxExtent(默认-180, -90, 180, 90)
c)        定义paddingForPopups(15, 15, 15, 15)
d)        定义theme(默认theme/default/style.css)
e)        定义id:"OpenLayers.Map_"+序号
f)        定义div:为展示地图的Dom元素
g)       
定义viewPortDiv:视口Dom元素(id:"OpenLayers.Map_"+ 序号 +
"_OpenLayers_ViewPort;OVERFLOW: hidden; POSITION:
relative;width:"100%";height:"100%";className:
"olMapViewport";),作为div的子元素

h)       
定义layerContainerDiv:存放图层的Dom元素(id:"OpenLayers.Map_"+ 序号 + "
_OpenLayers_Container";zIndex:this.Z_INDEX_BASE['Popup']-1;),作为
viewPortDiv的子元素。
Z_INDEX_BASE: { BaseLayer: 100, Overlay: 325, Popup: 750, Control: 1000 }定义events:object:map;element:div;
EVENT_TYPES:
[ "preaddlayer", "addlayer", "removelayer", "changelayer",
"movestart","move", "moveend", "zoomend", "popupopen", "popupclose",
"addmarker", "removemarker", "clearmarkers", "mouseover", "mouseout",
"mousemove", "dragstart", "drag", "dragend", "changebaselayer"]

i)        定义events:object: map;element:div; eventTypes:EVENT_TYPES;fallThrough:true
              i.              定义object:事件对应的js脚本对象
             ii.              定义element:响应浏览器事件的Dom元素
            iii.              定义eventTypes:事件类型
            iv.              定义fallThrough:是否穿透(停止事件传播)
             v.              定义listeners:事件监听者
            vi.              定义eventHandler:定义事件处理者:handleBrowserEvent
           vii.              向listeners中注册EVENT_TYPES
          viii.             
将BROWSER_EVENTS注册到EVENT_TYPES,在Dom元素element上注册BROWSER_EVENTS浏览器监听事件执行
eventHandler,在Dom元素element上注册"dragstart"事件执行OpenLayers.Event.stop。
BROWSER_EVENTS:
["mouseover", "mouseout","mousedown", "mouseup",
"mousemove","click","dblclick","resize", "focus", "blur"]j)       
updateSize响应"movestart"事件;updateSize响应"resize"事件;

k)        确保加载theme主题css样式;

l)        定义layers:图层;

m)      定义controls:(默认:Navigation、PanZoom、ArgParser、Attribution),设置control内部的 map对象,将controls添加到map中

  i.              Navigation:displayClass:olControlNavigation;events:active/deactive;
id:OpenLayers.Control.Navigation_ 序号;
map:地图对象;handlers.click:dblclick;dragPan、 zoomBox;handlers.wheel:MouseWheel;将要监听的事件添加到map的listeners中;

  ii.             
PanZoom:position:
(4,4);displayClass:olControlPanZoom;events:active/deactive;id:OpenLayers.Control.PanZoom_
序号;…;添加到viewPortDiv中;

  iii.             
ArgParser:displayClass:olControlArgParser;events:active/deactive;id:OpenLayers.Control.ArgParser_
序号;…;添加到viewPortDiv中;

  iv.             
Attribution:displayClass:olControlAttribution;events:active/deactive;id:OpenLayers.Control.Attribution_
序号;…;添加到viewPortDiv中;

n)        unloadDestroy:响应浏览器卸载事件 var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",                "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},                options);

2,   创建图层对象

a)        newArguments:name:"OpenLayers WMS", url:"http://labs.metacarta.com/wms/vmap0?", params:{layers: 'basic'}, options:resolutions: [1.40625,0.703125,0.3515625];
b)        OpenLayers.Layer.Grid.prototype.initialize: map.addLayers([ol_wms])
3,   将图层加入到地图中
a)        layer.div添加到layerContainerDiv

图例一


window

DOMMouseScroll

Handler.MouseWheel.wheelListener
mousewheel Handler.MouseWheel.wheelListener
unload Map.unloadDestroy


document

mousewheel Handler.MouseWheel.wheelListener

Div:

map

Div:



Layer.WMS

blur

Map.handleBrowserEvent

click

Map.handleBrowserEvent

dblclick

Map.handleBrowserEvent

dragstart

OpenLayers.Event.stop

focus

Map.handleBrowserEvent

mousedown

Map.handleBrowserEvent

mousemove

Map.handleBrowserEvent

mouseout

Map.handleBrowserEvent

mouseover

Map.handleBrowserEvent

mouseup

Map.handleBrowserEvent

resize

Map.handleBrowserEvent


Div:


OpenLayers_Control_PanZoom_panup


Div:

OpenLayers_Control_PanZoom_panleft


Div:

OpenLayers_Control_PanZoom_panright


Div:

OpenLayers_Control_PanZoom_pandown


Div:

OpenLayers_Control_PanZoom_zoomin


Div:

OpenLayers_Control_PanZoom_zoomworld


Div:

OpenLayers_Control_PanZoom_zoomout

click Control.PanZoom.doubleClick
dblclick Control.PanZoom.doubleClick
mousedown Control.PanZoom.buttonDown

图例二


Map.events.listeners

Addlayer Control.Attribution, Control.Attribution.updateAttribution

addmarker

 

Blur

 
changebaselayer Control.Attribution, Control.Attribution.updateAttribution
changelayer Control.Attribution, Control.Attribution.updateAttribution
clearmarkers  

Click

Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.click
Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.click
 
Dblclick  

Drag

 
Dragend  

dragstart

 

Focus

 
mousedown

Handler.Drag, handler.Drag.setEvent

Handler.Drag, handler.Drag.

mousedown

Handler.Click, handler.Click.setEvent
Handler.Click, handler.Click.dblclick
Handler.Click, handler.Click.setEvent
Handler.Click, handler.Click.click
Handler.Click, handler.Click.setEvent
Handler.Click, handler.Click.

mousedown

Handler.Drag, handler.Drag.setEvent

Handler.Drag, handler.Drag.

mousedown

mousemove

Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mousemove
Handler.MouseWheel, Handler.MouseWheel.setEven
Handler.MouseWheel, Handler.MouseWheel.mousemove
Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mousemove
 
Mouseout Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mouseout
Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mouseout
 

mouseover

 

Mouseup

Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mouseup
Handler.Drag, handler.Drag.setEvent
Handler.Drag, handler.Drag.mouseup
 
Move  
Moveend  
movestart

Map

,

map.

updateSize
 

popupclose
popupopen
preaddlayer
removelayer

Control.Attribution, Control.Attribution.updateAttribution

removemarker
resize

Map

,

map.

updateSize

Zoomend


Layer.WMS.events.listeners

blur  
click  
dblclick  
focus  
loadcancel  
loadend

 
loadstart  
mousedown  
mousemove  
mouseout  
mouseover  
mouseup  
resize  
tileloaded  
visibilitychanged  

图例三


Control.Navigation.events.listeners

active

 
deactive

 


Control.PanZoom.events.listeners

active

 
deactive

 


Control.ArgParser.events.listeners

active

 
deactive

 


Control.Attribution.events.listeners

active

 
deactive

 

OpenLayers Map理解的更多相关文章

  1. OpenLayers.Map的一些特殊事件

    开年上班的第二天,无意中看到一些没见过的事件,特地来给广大人民群众报个信. 众所周知的,map里面的 eventListeners 支持的事件挺多的,比如: var map = new OpenLay ...

  2. map 理解

    键值对 map会将同名的值覆盖掉 public static void main(String[] args) { Map<String,String> maptest=new HashM ...

  3. List,set,Map理解

    集合 集合与数组 数组(可以存储基本数据类型)是用来存现对象的一种容器,但是数组的长度固定,不适合在对象数量未知的情况下使用. 集合(只能存储对象,对象类型可以不一样)的长度可变,可在多数情况下使用. ...

  4. 使用 Code Map 理解复杂代码1 ——Visual Studio2012

    第一次知道code map是在Visual Studio Ultimate 2012自带的解说上面,当时认为十分好奇,所以查了查.结果一查就是好几天.原来Visual Studio Ultimate  ...

  5. openlayers 加载瓦片详解 一

    在这先说点题外话,本人在研究webgl 三维球过程中惊人发现,openlayers 的开发人员也在研究webgl并经证实他们也正在研发基于 webgl的三维gis开源平台,这可能是首个开源的三维平台, ...

  6. OpenLayers中的球面墨卡托投影

    最近看OpenLayers,研究到地图投影时找到官方的文档,就翻译了一下,由于英文能力差,翻译不好的地方,请看原文 原文地址:http://docs.openlayers.org/library/sp ...

  7. OpenLayers项目分析——(一)项目介绍

    OpenLayers 是由MetaCarta公司开发的,用于WebGIS客户端的JavaScript包,目前的最高版本是2.7 V,通过BSD License 发行.它实现访问地理空间数据的方法都符合 ...

  8. OpenLayers图层

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head ...

  9. openlayers中实现点的拖拽(modify),在layer中增加修改删除point。

    最近忙着整地图,都忘记了总结来沉淀自己,自我检讨一下. 总结一下最近使用openlayer时学习的内容,先说下我的业务逻辑吧,在室内地图中 1,点击新增在地图上新增一个可以拖拽的点,拖拽完成后确定位置 ...

随机推荐

  1. MySQL学习总结

    MySQL的学习总结,根据数据库的四大基本操作——”增删查改“分类整理.

  2. Win10下SQLServer2000的安装

    Win10的技术预览版已经发布近两个星期了,我也迫不及待地装上尝鲜,发现SQLServer2000在Win10上无法安装,在翻遍网上资料和经过无数次尝试后得到了一种安装方法,希望能够帮助遇到类似问题的 ...

  3. jQuery下通过$.browser来判断浏览器

    使用方法: $.browser.['浏览器关键字'] 代码如下: $(function() { if($.browser.msie) { alert("this is msie") ...

  4. Baidu set to lose leading role in digital advertising _china daily

    advertising: n,广告 Online search giant Baidu Inc is set to loset its top spot in the nation's booming ...

  5. [原创]cocos2d-x研习录-第三阶 多分辨率适配器

    在移动终端(智能手机)平台下开发游戏一般都会涉及到屏幕多分辨率适配问题,原因是手机款式多种多样,不同的款式存在有不同的尺寸,即使尺寸相同又可能存在不同的分辨率. 手机屏幕尺寸:指手机屏幕对角线长度. ...

  6. Controller

    http://www.cnblogs.com/artech/archive/2012/08/15/action-result-03.html

  7. CSharp 相关知识点小结

    1.JS获取iframe下面的内容document.getElementById('IFRAME1').contentDocument; 2.dialog 弹出层,定位:postion:'bottom ...

  8. JavaScript中的arguments,callee,caller

    在提到上述的概念之前,首先想说说javascript中函数的隐含参数: arguments: arguments 该对象代表正在执行的函数和调用它的函数的参数. [function.]argument ...

  9. [2015.02.02]文本编码转换专家 v2.6

    软件名称:文本编码转换专家最新版本:v2.6操作系统:XP/2003/Win7/Win2008软件介绍:文本编码转换专家,界面简洁易用,功能强大实用.自动识别文件编码,有效转换成目标编码.真正的多线程 ...

  10. 【python】python定时器

    #coding:utf-8 import os import time def print_ts(message): print "[%s] %s"%(time.strftime( ...