# smrest

> use leafletjs add SuperMap-rest map resource

Latest version **0.0.3** (published 2019-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install smrest
pnpm add smrest
yarn add smrest
bun add smrest
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-07-21 |
| First published | 2019-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | GerhardYang |
| Maintainers | gerhardyang |
| Keywords | leaflet, supermap, map, rest |

## Links

- npm: https://www.npmjs.com/package/smrest
- Repository: https://github.com/GerhardYang/SmREST
- Homepage: https://github.com/GerhardYang/SmREST#readme
- Issues: https://github.com/GerhardYang/SmREST/issues
- npm.io page: https://npm.io/package/smrest

## Recent versions

- 0.0.3 (latest) — 2019-07-21
- 0.0.2 — 2019-07-21
- 0.0.1 — 2019-07-21

## README

## Leaflet add SuperMap REST map


1. install this plugin
```
npm i smrest
```

2. import this plugin
```
import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
import 'smrest'
```

3. use  L.tileLayer.SmREST(url,option) add a SuperMap rest layer

```
url: like "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World"
```


```
option:{
		transparent: true,
		cacheEnabled: true,
		clipRegionEnabled: false,
		//地图显示裁剪的区域。(geometry)
		clipRegion: null,
		//请求的地图的坐标参考系统。 如：prjCoordSys={"epsgCode":3857}
		prjCoordSys: null,
		//地图对象在同一范围内时，是否重叠显示
		overlapDisplayed: false,
		//避免地图对象压盖显示的过滤选项
		overlapDisplayedOptions: null,
		//切片版本名称，cacheEnabled 为 true 时有效。
		tileversion: null,
		// serverType: ServerType.ISERVER,
		format: 'png',
} 
```
other options extends L.TileLayer 
[https://leafletjs.com/reference-1.5.0.html#tilelayer]


```
 L.tileLayer.SmREST(
          "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World",
          {
            noWrap: true,
            bounds: [[-90, -180], [90, 180]]
          }
        )
        .addTo(map);
```

---
_Source: https://npm.io/package/smrest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
