Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
text input to slider
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinabrokwa committed Oct 9, 2017
1 parent 6257193 commit 8f60a8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
search: <input id="search" type="text"/>
</div>
<div>
set cache size: <input id="cache-size" type="text"/><button id="cache-size-button">set</button>
<div>
set cache size: <input id="cache-size-input" type="range" min="0" max="150" value="50"/>
</div>
<div>cache size: <span id="cache-size">50</span></div>
</div>
<div id="map"></div>
<script src="index.js"></script>
Expand Down
7 changes: 4 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ function main(geojson) {
.forEach(id => vtLayer.setFeatureStyle(id, { color: 'black' }));
};

document.getElementById('cache-size-button').onclick = e => {
const size = +document.getElementById('cache-size').value;
vtLayer.setTileCacheSize(size);
document.getElementById('cache-size-input').onchange = e => {
const cacheSize = +e.target.value;
document.getElementById('cache-size').innerHTML = cacheSize;
vtLayer.setTileCacheSize(cacheSize);
};
}

0 comments on commit 8f60a8a

Please sign in to comment.