Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

HERE Maps API - How to pan the map

From Wiki
Jump to: navigation, search

This article explains how to use the panning method on the map. Feel free to modify and utilize whole or partial for your own purposes!

Article Metadata
Code ExampleTested with
Devices(s): Internet Explorer, Firefox, Google Chrome, Opera
Platform(s): Web browser
Dependencies: HERE Maps 2.5.3
Keywords: HERE Maps, JavaScript, Panning
Created: Maveric (27 Jun 2011)
Updated: avnee.nathani (31 Dec 2011)
Last edited: jasfox (28 Nov 2013)



HERE Maps API supported web browser (basically any modern browser should do).

Example code

After the map is intiallised, a timer is set up setInterval (panTheMap, 300); to pan the pan three times a second. The panning code is shown below:

function panTheMap() {  
x = x + incX;
if (Math.abs(x) > 20 ){
incX = -incX;
y= y + incY;
if (Math.abs(y) > 20 ){
incY = -incY;
map.pan(0, 0, x, y);



To see the example in action:

For more on the HERE Maps API

Please check out the HERE Maps API full documentation and API reference here:

You may also access the interactive API explorer


Using the map panning feature you could create e.g. a game, where the map is moving and the user should e.g. find something on the map and click it before the area vanishes from sight, just an idea ;) develop your own =)? Side scrolling game...? =)

This page was last modified on 28 November 2013, at 11:26.
93 page views in the last 30 days.