Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Map keep moving even after the key unpressed

3 replies [Last post]
Amri Shodiq
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 04/03/2010

Need help. It happens when I use Nutiteq for Blackberry.

I use UserDefinedKeysMapping to user 'A', 'W', 'D', and 'S' as map controller. But I'm facing this condition. When I press 'O', the map will zoom out once (I mean one level) and then stops. But when I press 'S', it keep moving up and I unable to stop it.

Here is my code:


keysMapping.defineKey(ControlKeys.ZOOM_OUT_KEY, 79); // 79 is ascii for O
keysMapping.defineKey(ControlKeys.ZOOM_IN_KEY, 73); // 73 is ascii for I
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 86);
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 83);
keysMapping.defineKey(ControlKeys.MOVE_LEFT_KEY, 65);
keysMapping.defineKey(ControlKeys.MOVE_RIGHT_KEY, 68);

Am I do something wrong? What is the solution?

Without this keys mapping, everything goes well with my trackpad.

Regards,
Amri

Amri Shodiq
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 04/03/2010

Sorry, I think I make mistake here:

keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 86);
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 83);

Solved.

jaak
User offline. Last seen 12 hours 26 min ago. Offline
Joined: 06/19/2008

It seems that your library does not get keyReleased events to stop panning.

a) check if you have following in your code:

  protected boolean keyUp(final int keyCode, 
      final int time) {
    mapComponent.keyReleased(Keypad.key(keyCode));
    return true;
  }

b) try different panning strategies
1) thread-driven, default:

mapComponent.setPanningStrategy(new ThreadDrivenPanning());

2) event-driven:

mapComponent.setPanningStrategy(new EventDrivenPanning());

/JaakL

Amri Shodiq
User offline. Last seen 9 weeks 2 days ago. Offline
Joined: 04/03/2010

Yes, it solved JaakL. Thanks a lot.