openlayers 学习笔记之1

1. 为Web Gis客户端开发的javascript 框架 百度文库中的教程:入门经典>

1) 初始化map:

 map = new OpenLayers.Map(mapContainerName, {
        controls: [new OpenLayers.Control.PanZoomBar({ zoomWorldIcon: true, position: new OpenLayers.Pixel(5, 22) }),
                       new OpenLayers.Control.Navigation(),
                       new OpenLayers.Control.LayerSwitcher(),
                       new OpenLayers.Control.ScaleLine({ maxWidth: 120, topOutUnits: "公里", topInUnits: "", bottomOutUnits: "", bottomInUnits: "" }),
                       new OpenLayers.Control.MousePosition({ prefix: "经度:", separator: ",纬度:" }),                      
                       new OpenLayers.Control.KeyboardDefaults(),
                       new OpenLayers.Control.TouchNavigation({ dragPanOptions: { enableKinetic: true } })
        ],       
        maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
        maxResolution: 156543.0339,
        numZoomLevels: 10,
        units: 'm',
        projection: "EPSG:900913",
        displayProjection: new OpenLayers.Projection("EPSG:4326")

}
View Code

2)瓦片行列式的计算

var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));

var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));

var z = this.map.getZoom();

 

2. 墨卡托投影(900913)是WGS84大地坐标系(经纬度)(4326)的投影(其中的一种投影方法),左右不变,上下拉长。

1) 地面分辨率Resolution: 一个像素表示多少米

2) 地图比例尺Scale:图上距离和实际距离的比例
maxResolution: 156543.0339,  //显示比例
Bounds (-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892), numZoomLevels : 19, // 全球bounds范围

 

 

缩放级别

 

地图宽度、高度(像素)

地面分辨率(米/像素)

地图比例尺(以96dpi为例)

0

256

156,543.0339

1 : 591,658,710.90

1

512

78,271.5170

1 : 295,829,355.45

2

1,024

39,135.7585

1 : 147,914,677.73

3

2,048

19,567.8792

1 : 73,957,338.86

4

4,096

9,783.9396

1 : 36,978,669.43

5

8,192

4,891.9698

1 : 18,489,334.72

6

16,384

2,445.9849

1 : 9,244,667.36

7

32,768

1,222.9925

1 : 4,622,333.68

8

65,536

611.4962

1 : 2,311,166.84

9

131,072

305.7481

1 : 1,155,583.42

10

262,144

152.8741

1 : 577,791.71

11

524,288

76.4370

1 : 288,895.85

12

1,048,576

38.2185

1 : 144,447.93

13

2,097,152

19.1093

1 : 72,223.96

14

4,194,304

9.5546

1 : 36,111.98

15

8,388,608

4.7773

1 : 18,055.99

16

16,777,216

2.3887

1 : 9,028.00

17

33,554,432

1.1943

1 : 4,514.00

18

67,108,864

0.5972

1 : 2,257.00

19

134,217,728

0.2986

1 : 1,128.50

20

268,435,456

0.1493

1 : 564.25

21

536,870,912

0.0746

1 : 282.12

22

1,073,741,824

0.0373

1 : 141.06

23

2,147,483,648

0.0187

1 : 70.53

 

1) google map 900913 地图分块算法,切片算法   》》》

2)墨卡托坐标和经纬度坐标互转 》》》

3)gis理论、墨卡托投影等 》》》

总数量:
http://www.map1000.com/jjj/mhQiantuMapHandler.ashx?searchType=2&f=getPoiCount&classId=8000100&regionCode=003910

GetPoiCountWithKey

getPoiCountWithClass

 

posted @ 2016-08-22 10:51  wangmeihong  阅读(566)  评论(0编辑  收藏  举报