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.

Archived:Optimize HERE Map Type Selector for Asha 305, Asha 306 and Asha 311

From Wiki
Jump to: navigation, search
Article Metadata
Series 40
Created: r60600 (12 Jul 2012)
Last edited: hamishwillee (09 May 2013)

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

This article uses a deprecated version of the Nokia Maps API for JavaScript to display a Map on a Java ME device. The Nokia Maps API for JavaScript is not considered to be an appropriate API to use in the Java ME environment, as a large JavaScript library would need to be regularly downloaded onto a memory constricted device, and un-cached Map tiles would need to be regularly requested which would result in a large amount of data traffic.

Nokia offers two alternative APIs which are more suitable for Java ME development

  • For a simple static map using the RESTful Maps API within a web widget is considered to be a reasonable lightweight solution.
  • For dynamic mapping use cases, the Nokia Maps API for Java ME is a Native API which would be preferred more complex development.
  • Static mapping services do not cache or tile the images when requested, therefore each request involves a round trip to the server. If the map on a mobile application needs to be refreshed at any time, using a caching library will result in a reduction in network traffic after around three maps have been displayed. An explanation of this can be found here
An article with the same functionality, written using the native Java ME API can be found in the Creating a Map Type Selector Example

Note.pngNote: This is an entry in the Asha Touch Competition 2012Q3

Asha 305, Asha 306, Asha 311 are Series 40 devices with new full touch UI which will provide a better user experience for map operation. And developers may not construct ScaleBar and ZoomBar for user. But these devices only support HTML 4.0, Developers can only use Nokia Map API for Web to display map in Browser or Widget.

This is a simple Nokia map example with TypeSelector.

<script type="text/javascript" charset=UTF-8"
<style type="text/css">
html {
body {
margin: 0;
padding: 0;
overflow: hidden;
#mapContainer {
width: 100%;
height: 100%;
left: 0;
top: 0;
position: absolute;
<body >
<div id="mapContainer"></div>
<script type="text/javascript">
var mapContainer = document.getElementById("mapContainer");
var map = new, {
components: [

After run,the TypeSelector may extend un-completely.


Because these 3 Asha devices's portrait screen width is less than width of horizontal extending TypeSelector. Maybe many developers don't think it's a question because user can rotate to landscape screen which has full width and is fit for 2 hands hold. But I think developers had better provide users another convenience way which let them operate map when only can use single hand.

So the newer version of Nokia Map API for Web is introduced to settle this question, only alter another Javascript file.

<script type="text/javascript" charset=UTF-8"

And the TypeSecector will extend vertical,


which is not only fit for 3 Nokia Asha devices but also for many other limited screen devices.

Way above is good but I prefer next which via increasing the width of the map container.

<script type="text/javascript" charset=UTF-8"
#mapContainer {
width: 150%;

The TypeSelector doesn't appear first


before user drag mapcontainer from right to left.


The TypeSelector can extend horizontal completely,


and be dragged,selected or closed.


Please read Archived:Update Nokia Online Maps Style for Asha Full Touch for better map services on Asha full touch.

This page was last modified on 9 May 2013, at 10:26.
197 page views in the last 30 days.