2018-12-14 13:44:39 +01:00
|
|
|
# Openstreetmap custom tag map
|
|
|
|
|
|
|
|
Label to generate the openstreetmap iframe from the country and region.
|
|
|
|
|
2018-12-14 13:56:49 +01:00
|
|
|
## Demo
|
|
|
|
|
|
|
|
``` html
|
2018-12-14 14:00:39 +01:00
|
|
|
<map address="valencia" region="spain" width="100%" height="300"></map>
|
2018-12-14 13:56:49 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Build the following result:
|
|
|
|
|
2018-12-16 21:48:54 +01:00
|
|
|
<img src="https://cdn.jsdelivr.net/gh/tanrax/openstreetmap-tag-map/demo.jpg">
|
2018-12-14 13:56:49 +01:00
|
|
|
|
2018-12-14 13:44:39 +01:00
|
|
|
## Install
|
|
|
|
|
|
|
|
### 1 Add Javascript dependencies.
|
|
|
|
|
|
|
|
- Axios
|
|
|
|
- Riot
|
|
|
|
- Riot compiler
|
2018-12-16 21:44:03 +01:00
|
|
|
- Openstreetmap Tag template
|
2018-12-14 13:44:39 +01:00
|
|
|
|
|
|
|
``` html
|
|
|
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/riot/3.13.2/riot.min.js"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/riot/3.13.2/riot+compiler.min.js"></script>
|
2018-12-16 21:44:03 +01:00
|
|
|
<script src="https://cdn.jsdelivr.net/gh/tanrax/openstreetmap-tag-map@1.0.0/tag.map" type="riot/tag"></script>
|
2018-12-14 13:44:39 +01:00
|
|
|
```
|
|
|
|
|
2018-12-16 21:49:35 +01:00
|
|
|
### 2 Mount Component
|
2018-12-14 13:44:39 +01:00
|
|
|
|
|
|
|
``` html
|
|
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
riot.mount('*')
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|
2018-12-16 21:44:03 +01:00
|
|
|
### 3 Add the HTML tag with your settings
|
2018-12-14 13:44:39 +01:00
|
|
|
|
|
|
|
``` html
|
2018-12-14 14:00:39 +01:00
|
|
|
<map address="valencia" region="spain" width="100%" height="300"></map>
|
2018-12-14 13:44:39 +01:00
|
|
|
```
|