Skip to content

Stupid (Unsupported) GeoMoose Tricks

Jim Klassen edited this page Dec 18, 2019 · 1 revision

You can control the map from the browser developer tools console. Command line addict that I am, I find this useful for moving around the application while testing/debugging.

function showMapInfo() { let m=app.store.getState().map; return {x:m.center[0], y:m.center[1], resolution: m.resolution, zoom: m.zoom}; }

showMapInfo();
-> Object { x: -10370351.141856, y: 5550949.728470501, resolution: 38.21851414258813, zoom: 12 }

app.setView({zoom: 15});
showMapInfo();
-> Object { x: -10370351.141856, y: 5550949.728470501, resolution: 4.777314267823516, zoom: 15 }

app.setView({center: [-10370351.141856, 5560949.728470501]});
-> Object { x: -10370351.141856, y: 5560949.728470501, resolution: 4.777314267823516, zoom: 15 }