Skip to content

Commit

Permalink
Fix zoom leven for overlay, and display of MousePositionControl
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim, Allen committed Feb 17, 2025
1 parent 37f384a commit cc261cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-openlayers",
"version": "10.0.0",
"version": "10.1.0",
"description": "React + OpenLayers",
"author": "Allen Kim",
"type": "module",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export function Overlay(props) {
const contentEl = popupEl.querySelector('#popup-content');
let address;
try {
address = await getAddress(lon, lat);
const zoom = Math.ceil(map.getView().getZoom());
address = await getAddress(lon, lat, zoom);
} catch(e) {
address = '';
console.error(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Primary = {
const format = createStringXY(4);
return (
<Map>
<MousePositionControl coordinateFormat={format} projection='ESPG:4326' />
<MousePositionControl coordinateFormat={format} projection='EPSG:4326' />
<TileLayer source={new OSM()} />
<View center={[-10997148, 4569099]} zoom={4}/>
</Map>
Expand Down

0 comments on commit cc261cf

Please sign in to comment.