Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (72 sloc) 2.93 KB
<!DOCTYPE html>
<meta charset='utf-8' />
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src=''></script>
<link href='' rel='stylesheet' />
body { margin:0; padding:0;
font-family: lato;}
#map { position:absolute; top:0; bottom:0; width:100%; }
.mapboxgl-popup {
max-width: 400px;
font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
#info {
padding: 25px;
background-color: rgba(0, 0, 0, .55);
#greater32{color:#ff8400;text-align: center;}
#less32{color:#d8d4d4;text-align: center;}
@media screen and (max-width: 40em) {
#info{font-size: xx-small;}
<div id='map'></div>
mapboxgl.accessToken = 'pk.eyJ1IjoiY3J1emluNzN2dyIsImEiOiJjaW80MHJvNzgwMWcwdmFrams0OHAxaWozIn0.6TXveIiYaYPFdf8QTO6Ssw';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/cruzin73vw/ciqmuv5y70000bhmb5sabnd0k',
center: [-118.483299, 34.024549],
hash: true,
zoom: 14,
map.on('click', function (e) {
var features = map.queryRenderedFeatures(e.point, { layers: ['greaterthan32','lessthan32'] });
if (!features.length) {
var feature = features[0];
var popup = new mapboxgl.Popup()
.setHTML("<p>Height: "" Feet")
// Use the same approach as above to indicate that the symbols are clickable
// by changing the cursor style to 'pointer'.
map.on('mousemove', function (e) {
var features = map.queryRenderedFeatures(e.point, { layers: ['greaterthan32','lessthan32'] });
map.getCanvas().style.cursor = (features.length) ? 'pointer' : '';
<div id="info">
<h2>samo exploration 1 | buildings > 32'</h1>
<h3 id="greater32">Bldg greater than 32'</h3>
<h3 id="less32">Bldgs less than 32'</h3>
<p>Using data from 2008, there are about <b>24,130</b> Buildings in the City of Santa Monica.</p>
<p><b>1,493</b> (about 6%) of those buildings are greater than or equal to 32 feet. <b>22,637</b> (about 94 %) buildings are less than 32 feet.</p><p>Click on a building to get the height</p>
<p>This exploratory map is intended for discussion purposes. There will be discrepancies, map info on <a href="">GITHUB</a></p>
<p>made by <a href="">theworksLA</a></p>
You can’t perform that action at this time.