Skip to content

Commit

Permalink
support importing as es module
Browse files Browse the repository at this point in the history
  • Loading branch information
gnijuohz committed Apr 2, 2018
1 parent 04dcdb4 commit 1197980
Show file tree
Hide file tree
Showing 20 changed files with 2,312 additions and 76,386 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.DS_Store
.project
.project
.cache
example/dist
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,30 @@

## Usage

They are two ways to use this extension, and two examples in `example` foler demonstrate each approach.

### Use it directly through script tag

```html
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw=="
crossorigin="" />
<script type="text/javascript" src="./lib/echarts.min.js"></script>
<script src="./lib/leaflet.js" integrity="sha512-mNqn2Wg7tSToJhvHcqfzLMU6J4mkOImSPTxVZAdo+lcPlk+GhZmYgACEe0x35K7YzW1zJ7XyJV/TT1MrdXvMcA=="
crossorigin=""></script>
<script type="text/javascript" src="../dist/echarts-leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw==" crossorigin="" />
<script src="./node_modules/echarts/dist/echarts-en.js"></script>
<script src="./node_modules/leaflet/dist/leaflet.js"></script>
<script src="../dist/echarts-leaflet.js"></script>
```

See [this example](./example/leaflet-multiple-layers.html).

### Use it as ES Module

```
import echarts from 'echarts/lib/echarts';
import 'echarts/lib/chart/scatter';
import 'echarts/lib/chart/effectScatter';
import './echarts-leaflet';
```

See [this example](./example/leaflet-single-layer.html). To run it, use `parcel leaflet-single-layer.html`. The usage of parcel can be found [here](https://parceljs.org/).

## ECharts Option

Expand Down Expand Up @@ -85,16 +101,16 @@ If you don't specify a label for a tile, it won't show up in the layer control.
```



## Demo

- [全国空气质量(Air quality in China)](http://gnijuohz.github.io/echarts-leaflet/example/leaflet-multiple-layers.html)

## Build

- `npm install`
- `yarn install`
- `rollup --config`


## License

MIT
Loading

0 comments on commit 1197980

Please sign in to comment.