{"id":13531133,"url":"https://github.com/gnijuohz/echarts-leaflet","last_synced_at":"2025-04-01T19:31:41.219Z","repository":{"id":48020504,"uuid":"97546641","full_name":"gnijuohz/echarts-leaflet","owner":"gnijuohz","description":"ECharts extension for visualizing data on leaftlet maps","archived":false,"fork":false,"pushed_at":"2021-08-10T22:50:57.000Z","size":882,"stargazers_count":127,"open_issues_count":18,"forks_count":65,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-23T16:40:40.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.jing-zhou.xyz/echarts-leaflet/example/leaflet-multiple-layers.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnijuohz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T03:06:36.000Z","updated_at":"2024-02-21T19:36:29.000Z","dependencies_parsed_at":"2022-08-12T16:50:45.670Z","dependency_job_id":null,"html_url":"https://github.com/gnijuohz/echarts-leaflet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnijuohz%2Fecharts-leaflet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnijuohz%2Fecharts-leaflet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnijuohz%2Fecharts-leaflet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnijuohz%2Fecharts-leaflet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnijuohz","download_url":"https://codeload.github.com/gnijuohz/echarts-leaflet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246700400,"owners_count":20819866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:00.371Z","updated_at":"2025-04-01T19:31:36.210Z","avatar_url":"https://github.com/gnijuohz.png","language":"JavaScript","funding_links":[],"categories":["Extensions"],"sub_categories":["Videos"],"readme":"# ECharts leaflet extension\n\n[![Build Status](https://travis-ci.org/gnijuohz/echarts-leaflet.svg?branch=master)](https://travis-ci.org/gnijuohz/echarts-leaflet)\n\n## Install\n\n`npm i echarts-leaflet`\n\n## Usage\n\nThere are two ways to use this extension, the two examples in the `example` folder demonstrate each approach.\n\n### Use it directly through the script tag\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.1.0/dist/leaflet.css\" integrity=\"sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw==\" crossorigin=\"\" /\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/echarts/4.0.4/echarts-en.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"../dist/echarts-leaflet.js\"\u003e\u003c/script\u003e\n```\n\nSee [this example](./example/leaflet-multiple-layers.html).\n\n### Use it as ES Module\n\n```\nimport echarts from 'echarts/lib/echarts';\nimport 'echarts/lib/chart/scatter';\nimport 'echarts/lib/chart/effectScatter';\n\nimport 'echarts-leaflet';\n```\n\nSee [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/).\n\n## ECharts Option\n\nYou can use one or more tile layers via the `tiles` option. It's an array of\nlayers.\n\nThe default tile layer uses `http://{s}.tile.osm.org/{z}/{x}/{y}.png`\n\n```javascript\noption = {\n  leaflet: {\n      center: [120.13066322374, 30.240018034923],\n      zoom: 3,\n      roam: true,\n      tiles: [{\n        label: 'OpenStreetMap',\n        urlTemplate: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',\n        options: {\n          attribution: '\u0026copy; \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e, Tiles courtesy of \u003ca href=\"http://hot.openstreetmap.org/\" target=\"_blank\"\u003eHumanitarian OpenStreetMap Team\u003c/a\u003e'\n        }\n      }]\n  },\n  series: [{\n    coordinateSystem: 'leaflet',\n  }]\n}\n```\n\nSpecify multiple layers. You can choose a base layer to use via the layer control.\n\n```javascript\n{\n  layerControl: {\n    position: 'topleft'\n  },\n  tiles: [{\n    label: '天地图',\n    urlTemplate: 'http://t2.tianditu.com/DataServer?T=vec_w\u0026x={x}\u0026y={y}\u0026l={z}',\n    options: {\n      attribution: 'tianditu.com'\n    }\n  }, {\n    label: 'Open Street Map',\n    urlTemplate: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',\n    options: {\n      attribution: '\u0026copy; \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e, Tiles courtesy of \u003ca href=\"http://hot.openstreetmap.org/\" target=\"_blank\"\u003eHumanitarian OpenStreetMap Team\u003c/a\u003e'\n    }\n  }]\n}\n```\n\nIf you don't specify a label for a tile, it won't show up in the layer control. Therefore the following option will add two base layers to the map and there is no way to switch between them.\n\n```javascript\n{\n  layerControl: {\n    position: 'topleft'\n  },\n  tiles: [{\n    urlTemplate: 'http://t2.tianditu.com/DataServer?T=vec_w\u0026x={x}\u0026y={y}\u0026l={z}',\n    options: {\n      attribution: 'tianditu.com'\n    }\n  }, {\n    urlTemplate: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',\n    options: {\n      attribution: '\u0026copy; \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e, Tiles courtesy of \u003ca href=\"http://hot.openstreetmap.org/\" target=\"_blank\"\u003eHumanitarian OpenStreetMap Team\u003c/a\u003e'\n    }\n  }]\n}\n```\n\n\n## Demo\n\n- [全国空气质量(Air quality in China)](http://gnijuohz.github.io/echarts-leaflet/example/leaflet-multiple-layers.html)\n\n## Build\n\n- `yarn install`\n- `rollup --config`\n\n## Contributors\n\n- [Jing Zhou](https://github.com/gnijuohz)\n- [UltramanWeiLai](https://github.com/UltramanWeiLai)\n- [Poyoman39](https://github.com/Poyoman39)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnijuohz%2Fecharts-leaflet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnijuohz%2Fecharts-leaflet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnijuohz%2Fecharts-leaflet/lists"}