Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Added overlay with details.
Browse files Browse the repository at this point in the history
  • Loading branch information
xivk committed Feb 8, 2018
1 parent c928fef commit bdb52a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
#features {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 300px;
overflow: auto;
background: rgba(255, 255, 255, 0.8);
}
</style>
</head>
<body>

<pre id='features'></pre>
<div id='map'></div>

<script>
Expand Down Expand Up @@ -130,6 +140,11 @@
"maxzoom": 16
});
});

map.on('mousemove', function (e) {
var features = map.queryRenderedFeatures(e.point);
document.getElementById('features').innerHTML = JSON.stringify(features, null, 2);
});
</script>

</body>
Expand Down

0 comments on commit bdb52a3

Please sign in to comment.