Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion develop/tests/playground.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Playground', () => {
const props$ = (new BehaviorSubject(1))
.distinctUntilChanged(comparator);

props$.subscribe(v => console.log(v));
props$.subscribe(v => console.log(v)); // eslint-disable-line
props$.next(1);
props$.next(2);
props$.next(1);
Expand Down
2 changes: 1 addition & 1 deletion src/google_map_markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class GoogleMapMarkers extends Component {
}
}

_onMouseChangeHandler_raf = () => {
_onMouseChangeHandler_raf = () => { // eslint-disable-line
if (!this.dimesionsCache_) {
return;
}
Expand Down
18 changes: 18 additions & 0 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,27 @@ const exports = {
y: 0.5 * (nwWorld.y + seWorld.y),
};

const scale = Math.pow(2, zoom);
const halfW = width / scale / GOOGLE_TILE_SIZE / 2;
const halfH = height / scale / GOOGLE_TILE_SIZE / 2;

const newNW = world2LatLng({
x: middle.x - halfW,
y: middle.y - halfH,
});

const newSE = world2LatLng({
x: middle.x + halfW,
y: middle.y + halfH,
});

return {
center: world2LatLng(middle),
zoom,
newBounds: {
nw: newNW,
se: newSE,
},
};
},

Expand Down