×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Update Nokia Online Maps Style for Asha Full Touch

From Nokia Developer Wiki
Jump to: navigation, search
r60600 (Talk | contribs)
(R60600 -)
 
hamishwillee (Talk | contribs)
m (Text replace - "[[Category:Series 40 Web Apps" to "[[Category:Nokia Asha Web Apps")
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Series 40 Web Apps]][[Category:Nokia Maps]]
+
[[Category:Nokia Asha Web Apps]][[Category:HERE Maps]][[Category:JavaScript]]
[[Category:Series 40 Web Apps]][[Category:Nokia Maps]]  
+
{{ArticleMetaData <!-- v1.2 -->
  {{Note|This is an entry in the [[Asha Touch Competition 2012Q3]]}}   
+
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
[http://maps.nokia.com/ Nokia Online Maps] is designed for desktop or laptop system,which can be saved as a single HTML file via IE or other browsers.Developers can also make the file as the homepage of their WWW site or S40 Web App and add new style in it for corresponding devices at the same time.
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
Code below will reconstruct a map with basic function for full touch(such as [http://www.developer.nokia.com/Devices/Device_specifications/Asha_305/ Asha 305], [http://www.developer.nokia.com/Devices/Device_specifications/Asha_306/ Asha 306], [http://www.developer.nokia.com/Devices/Device_specifications/Asha_311/ Asha 311] ).  
+
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20120808
 +
|author= [[User:R60600]]
 +
}}
 +
{{SeeAlso|
 +
* [http://developer.here.net/java Maps API for Java ME]
 +
* [http://developer.here.net/rest_api RESTful Maps API]
 +
* [http://developer.here.net/javascript_api Nokia Maps API]
 +
* [[How to create custom Map View in Java ME|Custom Map Views]]
 +
}}
 +
 
 +
{{Archived|timestamp=20130201151019|user=[[User:Jasfox|Jasfox]]|
 +
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 [http://developer.here.net/rest_api RESTful Maps API] within a web widget is considered to be a reasonable lightweight solution.
 +
* For '''dynamic''' mapping use cases, the  [http://developer.here.net/java 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  [[Using the RESTful Map API with Java ME#Comparision of Network traffic generated by the RESTful Map API and Maps API for Java ME|here]]
 +
 
 +
An article with the same functionality, written using the native Java ME API can be found in the [[How to create custom Map View in Java ME|Custom Map Views Example]]
 +
}}
 +
{{Note|This is an entry in the [[Asha Touch Competition 2012Q3]]}}   
 +
[http://maps.nokia.com/ Nokia Maps] is designed for desktop or laptop system, which can be saved as a single HTML file via IE or other browsers. Developers can also make the file as the homepage of their website or Series 40 Web App and add new style in it for corresponding devices at the same time.
 +
 
 +
Code below will reconstruct a map with basic function for Asha full touch(such as [http://www.developer.nokia.com/Devices/Device_specifications/Asha_305/ Asha 305], [http://www.developer.nokia.com/Devices/Device_specifications/Asha_306/ Asha 306], [http://www.developer.nokia.com/Devices/Device_specifications/Asha_311/ Asha 311] ).  
  
 
<code javascript>
 
<code javascript>
Line 47: Line 87:
 
</code>
 
</code>
  
Of course,the style can also be saved into a css file linked to the homepage.
+
Of course, the style can also be saved into a css file linked to the homepage.
  
Launching the app in simulator
+
Launching the app in simulator.
  
 
[[file: NokiaOnlineMapsforAshaPositioning.JPG]]
 
[[file: NokiaOnlineMapsforAshaPositioning.JPG]]
Line 56: Line 96:
  
 
[[file:NokiaOnlineMapsforAshaPublicTransport.JPG]]
 
[[file:NokiaOnlineMapsforAshaPublicTransport.JPG]]
 +
 +
Nokia Online Maps is ported on handheld system with better effect.

Latest revision as of 13:26, 9 May 2013

Article Metadata
Article
Created: r60600 (08 Aug 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 Custom Map Views Example

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

Nokia Maps is designed for desktop or laptop system, which can be saved as a single HTML file via IE or other browsers. Developers can also make the file as the homepage of their website or Series 40 Web App and add new style in it for corresponding devices at the same time.

Code below will reconstruct a map with basic function for Asha full touch(such as Asha 305, Asha 306, Asha 311 ).

...
<link type="text/css" rel="stylesheet"
href="http://static2.maps.nokia.com.cn/37115/resources/core/css/screen.c.css"/>
<style>
/*Hide top and app bar for large display area.*/
#topbar, #nokiamaps #appbar{height:0px;visibility:hidden}
#nokiamaps #appbar div div form input{height:0;padding:0;border:0}
 
/*Adjust the map's size and location.*/
#map{width:auto}
#nokiamaps.maps #application{top:0}
 
/*Reduce width of the control bar.*/
.MCControlbar{top:0px;left:0px;right:auto}
.MCCBTab1 .MCTLinner,.MCCBTab2 .MCTLinner{padding-right:0}
.MCTriangle, .MCTLTabDisabled .MCTLinner .MCTriangle{visibility:hidden}
.MCTDelimiter, .MCHorizontalDelimiter{visibility:hidden}
.MCCBTabsContainer .MCTLempty{width:8px}
 
/*Most mobiles don't support 3D map.*/
#trackingLink3D{height:0px;visibility:hidden}
 
/*Set the better location for mobiles.*/
.MCNavContainer{left:auto;top:auto;right:170%;bottom:auto;width:auto;Height:17%}
 
/*No use in most mobiles.*/
.MCMinimapBtn{visibility:hidden}
 
/*Full touch may not have these components.*/
.MCPan, .MCZoom{visibility:hidden}
 
/*Too long to display.*/
.MCCopyright{visibility:hidden}
</style>
<!--[if lt IE 9]>
<link type="text/css" rel="stylesheet"
href="http://static2.maps.nokia.com.cn/37115/resources/core/css/screen.ie.c.css"/>
<![endif]-->
...

Of course, the style can also be saved into a css file linked to the homepage.

Launching the app in simulator.

NokiaOnlineMapsforAshaPositioning.JPG

NokiaOnlineMapsforAshaChooseView.JPG

NokiaOnlineMapsforAshaPublicTransport.JPG

Nokia Online Maps is ported on handheld system with better effect.

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

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×