Skip to content

Commit

Permalink
On screen smaller than 768 width, center the map on eastcoast
Browse files Browse the repository at this point in the history
  • Loading branch information
CrucifixArnaud committed Mar 27, 2017
1 parent c0be08a commit 21a7a4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/assets/js/atlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,18 @@ export default class Atlas extends React.Component {
loader.remove();
});

let initialLatLng = [];

if(window.innerWidth < 768) {
initialLatLng = [40, -75];
}else{
initialLatLng = [40, -45];
}

this.map = L.mapbox.map('map', 'mapbox.dark', {
minZoom: 3.5,
zoomControl: false
}).setView([40, -45], 3);
}).setView(initialLatLng, 3.5);

new L.Control.Zoom({ position: 'topright' }).addTo(this.map);

Expand Down

0 comments on commit 21a7a4b

Please sign in to comment.