Skip to content

Commit b00f735

Browse files
author
潘卓然-中地数码台式机
committed
补充openlayer的坐标转换的函数以及说明
1 parent 91a2895 commit b00f735

8 files changed

Lines changed: 126 additions & 6 deletions

File tree

config/config-openlayers.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,35 +227,40 @@ var config = {
227227
diffcult: "1",
228228
detail: "测试基本的图片标注",
229229
icon: "addpicture.png",
230-
update: "最后更新时间:2018-07-16"
230+
person:"基础平台/创新中心-潘卓然",
231+
update: "最后更新时间:2018-11-22"
231232
}, {
232233
name: "文字标注",
233234
file: "addtext",
234235
diffcult: "1",
235236
detail: "测试基本的文字标注",
236237
icon: "addtext.png",
237-
update: "最后更新时间:2018-07-16"
238+
person:"基础平台/创新中心-潘卓然",
239+
update: "最后更新时间:2018-11-22"
238240
}, {
239241
name: "图文标注",
240242
file: "addtextandpic",
241243
diffcult: "1",
242244
detail: "测试基本的图文标注",
243245
icon: "addtextandpic.png",
244-
update: "最后更新时间:2018-07-16"
246+
person:"基础平台/创新中心-潘卓然",
247+
update: "最后更新时间:2018-11-22"
245248
}, {
246249
name: "Popup弹出框",
247250
file: "addpopup",
248251
diffcult: "1",
249252
detail: "测试基本的Popup弹出框",
250253
icon: "addpopup.png",
251-
update: "最后更新时间:2018-07-16"
254+
person:"基础平台/创新中心-潘卓然",
255+
update: "最后更新时间:2018-11-22"
252256
}, {
253257
name: "聚合标注",
254258
file: "addclusterlabels",
255259
diffcult: "1",
256260
detail: "测试基本的聚合标注",
257261
icon: "addclusterlabels.png",
258-
update: "最后更新时间:2018-07-16"
262+
person:"基础平台/创新中心-潘卓然",
263+
update: "最后更新时间:2018-11-22"
259264
}]
260265
},
261266
{

demo/openlayers/example/map/mapmarker/addpopup.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
</div>
100100
</div>
101101
<script type="text/javascript">
102-
var beijing = [116.28, 39.54];
102+
var beijing = ol.proj.fromLonLat([116.28, 39.54]);
103103
//示例标注点北京市的信息对象
104104
var featuerInfo = {
105105
geo: beijing,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### 核心关键
2+
#### 坐标转换
3+
4+
1. 由于日常生活中使用`经纬度`较多,而默认的地图的投影坐标系是`Web墨卡托`
5+
2. 经纬度的坐标在Web墨卡托下的位置是世界的中心,即非洲的某个地方,如下图所示
6+
![error](../demo/openlayers/markdown/map/mapmarker/addpopup.png)
7+
3. 需要针对`经纬度`数据进行对应的坐标转换
8+
9+
|投影类型|投影范围|EPSG号码|Proj4指令|
10+
|:---|:---|:---|:---|
11+
|Web墨卡托_WGS1984|[20037508.3427892, -20037508.3427892]|EPSG:3857|+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs|
12+
|WGS1984_度|[180, -180]|EPSG:4326|+proj=longlat +datum=WGS84 +no_defs|
13+
|地理坐标系(西安)_|[180, -180]|EPSG:4610|+proj=longlat +a=6378140 +b=6356755.288157528 +units=degrees +no_defs|
14+
|地理坐标系(北京)_|[180, -180]|EPSG:4214| +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs|
15+
|中国2000国家大地坐标系_度|[180, -180]|EPSG:4490|+proj=longlat +ellps=GRS80 +units=degrees +no_defs|
16+
17+
> [EPSG官方网址](http://epsg.io/)
18+
> [Proj4官方网址](http://proj4js.org/)
19+
20+
#### 核心代码
21+
22+
> `ol.proj.fromLonLat([116.28, 39.54]))`
23+
> > 返回的是地图map设置的地理坐标系坐标,默认是EPSG:3857(Web墨卡托)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### 核心关键
2+
#### 坐标转换
3+
4+
1. 由于日常生活中使用`经纬度`较多,而默认的地图的投影坐标系是`Web墨卡托`
5+
2. 经纬度的坐标在Web墨卡托下的位置是世界的中心,即非洲的某个地方,如下图所示
6+
![error](../demo/openlayers/markdown/map/mapmarker/addpopup.png)
7+
3. 需要针对`经纬度`数据进行对应的坐标转换
8+
9+
|投影类型|投影范围|EPSG号码|Proj4指令|
10+
|:---|:---|:---|:---|
11+
|Web墨卡托_WGS1984|[20037508.3427892, -20037508.3427892]|EPSG:3857|+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs|
12+
|WGS1984_度|[180, -180]|EPSG:4326|+proj=longlat +datum=WGS84 +no_defs|
13+
|地理坐标系(西安)_|[180, -180]|EPSG:4610|+proj=longlat +a=6378140 +b=6356755.288157528 +units=degrees +no_defs|
14+
|地理坐标系(北京)_|[180, -180]|EPSG:4214| +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs|
15+
|中国2000国家大地坐标系_度|[180, -180]|EPSG:4490|+proj=longlat +ellps=GRS80 +units=degrees +no_defs|
16+
17+
> [EPSG官方网址](http://epsg.io/)
18+
> [Proj4官方网址](http://proj4js.org/)
19+
20+
#### 核心代码
21+
22+
> `ol.proj.fromLonLat([116.28, 39.54]))`
23+
> > 返回的是地图map设置的地理坐标系坐标,默认是EPSG:3857(Web墨卡托)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### 核心关键
2+
#### 坐标转换
3+
4+
1. 由于日常生活中使用`经纬度`较多,而默认的地图的投影坐标系是`Web墨卡托`
5+
2. 经纬度的坐标在Web墨卡托下的位置是世界的中心,即非洲的某个地方,如下图所示
6+
![error](../demo/openlayers/markdown/map/mapmarker/addpopup.png)
7+
3. 需要针对`经纬度`数据进行对应的坐标转换
8+
9+
|投影类型|投影范围|EPSG号码|Proj4指令|
10+
|:---|:---|:---|:---|
11+
|Web墨卡托_WGS1984|[20037508.3427892, -20037508.3427892]|EPSG:3857|+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs|
12+
|WGS1984_度|[180, -180]|EPSG:4326|+proj=longlat +datum=WGS84 +no_defs|
13+
|地理坐标系(西安)_|[180, -180]|EPSG:4610|+proj=longlat +a=6378140 +b=6356755.288157528 +units=degrees +no_defs|
14+
|地理坐标系(北京)_|[180, -180]|EPSG:4214| +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs|
15+
|中国2000国家大地坐标系_度|[180, -180]|EPSG:4490|+proj=longlat +ellps=GRS80 +units=degrees +no_defs|
16+
17+
> [EPSG官方网址](http://epsg.io/)
18+
> [Proj4官方网址](http://proj4js.org/)
19+
20+
#### 核心代码
21+
22+
> `ol.proj.fromLonLat([116.28, 39.54]))`
23+
> > 返回的是地图map设置的地理坐标系坐标,默认是EPSG:3857(Web墨卡托)
21.6 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### 核心关键
2+
#### 坐标转换
3+
4+
1. 由于日常生活中使用`经纬度`较多,而默认的地图的投影坐标系是`Web墨卡托`
5+
2. 经纬度的坐标在Web墨卡托下的位置是世界的中心,即非洲的某个地方,如下图所示
6+
![error](../demo/openlayers/markdown/map/mapmarker/addpopup.png)
7+
3. 需要针对`经纬度`数据进行对应的坐标转换
8+
9+
|投影类型|投影范围|EPSG号码|Proj4指令|
10+
|:---|:---|:---|:---|
11+
|Web墨卡托_WGS1984|[20037508.3427892, -20037508.3427892]|EPSG:3857|+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs|
12+
|WGS1984_度|[180, -180]|EPSG:4326|+proj=longlat +datum=WGS84 +no_defs|
13+
|地理坐标系(西安)_|[180, -180]|EPSG:4610|+proj=longlat +a=6378140 +b=6356755.288157528 +units=degrees +no_defs|
14+
|地理坐标系(北京)_|[180, -180]|EPSG:4214| +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs|
15+
|中国2000国家大地坐标系_度|[180, -180]|EPSG:4490|+proj=longlat +ellps=GRS80 +units=degrees +no_defs|
16+
17+
> [EPSG官方网址](http://epsg.io/)
18+
> [Proj4官方网址](http://proj4js.org/)
19+
20+
#### 核心代码
21+
22+
> `ol.proj.fromLonLat([116.28, 39.54]))`
23+
> > 返回的是地图map设置的地理坐标系坐标,默认是EPSG:3857(Web墨卡托)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### 核心关键
2+
#### 坐标转换
3+
4+
1. 由于日常生活中使用`经纬度`较多,而默认的地图的投影坐标系是`Web墨卡托`
5+
2. 经纬度的坐标在Web墨卡托下的位置是世界的中心,即非洲的某个地方,如下图所示
6+
![error](../demo/openlayers/markdown/map/mapmarker/addpopup.png)
7+
3. 需要针对`经纬度`数据进行对应的坐标转换
8+
9+
|投影类型|投影范围|EPSG号码|Proj4指令|
10+
|:---|:---|:---|:---|
11+
|Web墨卡托_WGS1984|[20037508.3427892, -20037508.3427892]|EPSG:3857|+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs|
12+
|WGS1984_度|[180, -180]|EPSG:4326|+proj=longlat +datum=WGS84 +no_defs|
13+
|地理坐标系(西安)_|[180, -180]|EPSG:4610|+proj=longlat +a=6378140 +b=6356755.288157528 +units=degrees +no_defs|
14+
|地理坐标系(北京)_|[180, -180]|EPSG:4214| +proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs|
15+
|中国2000国家大地坐标系_度|[180, -180]|EPSG:4490|+proj=longlat +ellps=GRS80 +units=degrees +no_defs|
16+
17+
> [EPSG官方网址](http://epsg.io/)
18+
> [Proj4官方网址](http://proj4js.org/)
19+
20+
#### 核心代码
21+
22+
> `ol.proj.fromLonLat([116.28, 39.54]))`
23+
> > 返回的是地图map设置的地理坐标系坐标,默认是EPSG:3857(Web墨卡托)

0 commit comments

Comments
 (0)