Skip to content

Commit 5037880

Browse files
committed
【update】 更新 openlayers readme review by songym
1 parent 6d49142 commit 5037880

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/openlayers/README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# @supermap/iclient-openlayers
1+
# @supermap/iclient-ol
22

3-
@supermap/iclient-openlayers 是一套基于 OpenLayers 的云 GIS 网络客户端开发平台, 支持访问 SuperMap iServer / iEdge / iPortal / iManager / Online 的地图、服务和资源,为用户提供了完整专业的 GIS 能力, 同时提供了优秀的可视化功能。
4-
5-
目前支持的OpenLayers版本为4.6.5,最新的5.x支持版本还在开发中。
3+
@supermap/iclient-ol 是一套基于 OpenLayers 的云 GIS 网络客户端开发平台, 支持访问 SuperMap iServer / iEdge / iPortal / iManager / Online 的地图、服务和资源,为用户提供了完整专业的 GIS 能力, 同时提供了优秀的可视化功能。
64

75
## 简介
86
* 官网:[https://iclient.supermap.io](https://iclient.supermap.io)
@@ -11,37 +9,40 @@
119
## 安装
1210

1311
```
14-
npm install @supermap/iclient-openlayers
12+
npm install @supermap/iclient-ol
1513
```
14+
如果您使用的是 OpenLayers 4,请参考此[文档](https://www.npmjs.com/package/@supermap/iclient-openlayers/v/10.0.0)安装 SuperMap iClient for OpenLayers。
1615

1716
## 开发
1817

1918
在 HTML 文件中引入 CSS 文件
2019

2120
```html
22-
<link href='https://openlayers.org/en/v4.6.5/css/ol.css' rel='stylesheet' />
23-
24-
<link href='https://iclient.supermap.io/dist/openlayers/iclient-openlayers.min.css' rel='stylesheet' />
21+
<link href='https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.1.1/css/ol.css' rel='stylesheet' />
2522

23+
<link href='https://iclient.supermap.io/dist/ol/iclient-ol.min.css' rel='stylesheet' />
2624
```
2725
在 JS 文件中加入如下代码
2826

2927
```js
30-
import ol from 'openlayers';
31-
import {Logo, TileSuperMapRest} from '@supermap/iclient-openlayers';
28+
import Map from 'ol/Map';
29+
import View from 'ol/View';
30+
import TileLayer from 'ol/layer/Tile';
31+
import * as control from 'ol/control';
32+
import { Logo, TileSuperMapRest } from '@supermap/iclient-ol';
3233

3334
var url = "https://iserver.supermap.io/iserver/services/map-world/rest/maps/World";
34-
var map = new ol.Map({
35+
var map = new Map({
3536
target: 'map',
36-
controls: ol.control.defaults({attributionOptions: {collapsed: false}})
37+
controls: control.defaults({attributionOptions: {collapsed: false}})
3738
.extend([new Logo()]),
38-
view: new ol.View({
39+
view: new View({
3940
center: [0, 0],
4041
zoom: 2,
4142
projection: 'EPSG:4326'
4243
})
4344
});
44-
var layer = new ol.layer.Tile({
45+
var layer = new TileLayer({
4546
source: new TileSuperMapRest({
4647
url: url,
4748
wrapX: true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy