Skip to content

Commit

Permalink
fix offsetMap bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Mar 12, 2014
1 parent 589acb3 commit c0607ca
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,9 @@ function generatePlacenamesObject(markers){
function offsetMap(e){
mapWidth = $('#blacklight-map').width();
mapHeight = $('#blacklight-map').height();
map.panBy([(e.originalEvent.layerX - (mapWidth/4)), (e.originalEvent.layerY - (mapHeight/2))]);
if (!e.latlng.equals(map.getCenter())){
map.panBy([(e.originalEvent.layerX - (mapWidth/4)), (e.originalEvent.layerY - (mapHeight/2))]);
}else{
map.panBy([(mapWidth/4), 0]);
}
}

0 comments on commit c0607ca

Please sign in to comment.