Trimble MAPS API zooming is affecting the entire web page

143 Views Asked by At

Using the Trimble MAPS JavaScript API, the key down events for zooming (+/-) are affecting all the fields on the web page.

It there a way to unregister the map keypress event or focus it only on the map window and not the entire document?

1

There are 1 best solutions below

0
glutz On

Implementing the following JavaScript snippet into your code will prevent zooming in/out on "+"/"-" key press :

for (var c in map.controls){
      if(map.controls[c].CLASS_NAME == "ALKMaps.Control.KeyboardDefaults"){
        map.controls[c].deactivate();
      }
 }

https://developer.trimblemaps.com/ has more details.