1.1.1 • Published 6 years ago
openlayers-component v1.1.1
openlayers-wrapper-polymer3
Add maps into your application or page in an easy way 🌎
Installation
npm
npm install --save openlayers-component
unpkg
You can add the following in the \<head> of your html :
<script src="https://unpkg.com/openlayers-component@${version}/dist/main.js"></script>Usage
Add the custom element tag where you want to show the map
<openlayers-map></openlayers-map>You can add attributes to configure the initial view and the source of your base layer
<openlayers-map
   view-lon="-60.712829"
   view-lat="-31.641445"
   view-zoom="14"
   tile-source="http://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"
>
</openlayers-map>Size
Place the custom element in a div with the desired dimensions
<div class="map-container" style="width:100%;height: 300px;">
	<openlayers-map></openlayers-map>
</div>Updating view dynamically
You can modify the view programatically, changing element attribute values
const map = document.querySelector("#map1");
map.setAttribute("view-lon","-60.62");
map.setAttribute("view-lat","-31.62");
map.setAttribute("view-zoom","11");Add markers dinamically
const map = document.querySelector("#map1");
map.appendChild(new MapMarker({longitude:-60.698051,latitude: -31.614810, color:"#FFDC45"}));
map.appendChild(new MapMarker({longitude:-60.721049,latitude: -31.654999, color:"#46E8D4"})); 
map.appendChild(new MapMarker({longitude:-60.711903,latitude: -31.662787, color:"#0090FE"}));1.1.1
6 years ago
1.1.0
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.10
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago