TransWikia.com

Get extent on every zoom or pan of map

Geographic Information Systems Asked on September 27, 2021

map.getView().calculateExtent(map.getSize())

I am able to get extent using the above but I want the extent on every zoom/pan of map.. do we have any functions that can do it? i looked at zoom interactions and zoom to extent but none of those do what i want.

2 Answers

try:

map.on('moveend', function() {
    var extent = map.getView().calculateExtent(map.getSize())
});

as suggested by M.Moraca

Correct answer by cm1 on September 27, 2021

The correct way is this:

map.on('moveend', function() {
    var extent = map.getView().calculateExtent(map.getSize())
});

Thanks the indications from @TomazicM here

Answered by Massimiliano Moraca on September 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP