Skip to content

Commit

Permalink
Actually an unsigned/signed integer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
theopolisme committed Apr 17, 2019
1 parent af88453 commit 8234264
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h2>Render complete!</h2>
<script src="lib/leaflet.heat.min.js"></script>
<script src="lib/prettysize.js"></script>
<script src="lib/oboe-browser.min.js"></script>
<script src="index.js"></script>
<script src="index.js?v=3"></script>

<!-- BEGIN GOOGLE ANALYTICS -->
<script>
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
var latitude = location.latitudeE7 * SCALAR_E7,
longitude = location.longitudeE7 * SCALAR_E7;

// Handle negative latlngs.
if ( latitude > 180 ) latitude = -latitude % 180;
if ( longitude > 180 ) longitude = -longitude % 180;
// Handle negative latlngs due to google unsigned/signed integer bug.
if ( latitude > 180 ) latitude = latitude - (2 ** 32) * SCALAR_E7;
if ( longitude > 180 ) longitude = longitude - (2 ** 32) * SCALAR_E7;

if ( type === 'json' ) latlngs.push( [ latitude, longitude ] );
return oboe.drop;
Expand Down

0 comments on commit 8234264

Please sign in to comment.