×
Namespaces

Variants
Actions
(Difference between revisions)

HERE Maps API - Add a map into your Blogger post

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot addition of Template:ArticleMetaData)
avnee.nathani (Talk | contribs)
(Avnee.nathani - Updated the article to Nokia Maps Javascript API v2.0.)
Line 1: Line 1:
 +
[[Category:Web]][[Category:Browser]][[Category:Nokia Maps]]
 +
{{Abstract|This article explains how to add a map to your blog post. }}
 +
 
{{ArticleMetaData
 
{{ArticleMetaData
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
+
|devices=Google Chrome 11.0x, Mozilla Firefox 5.0
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
+
|dependencies=Nokia Maps 2.1.0
 
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
Line 17: Line 20:
 
|review-by=<!-- After re-review: [[User:username]] -->
 
|review-by=<!-- After re-review: [[User:username]] -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
|update-by= <!-- After significant update: [[User:username]]-->
+
|update-by=[[User:avnee.nathani]]
|update-timestamp= <!-- After significant update: YYYYMMDD -->
+
|update-timestamp= 20120112
 
|creationdate=20110620
 
|creationdate=20110620
 
|author=[[User:Maveric]]
 
|author=[[User:Maveric]]
 
}}
 
}}
  
[[Category:Web]][[Category:Browser]][[Category:Nokia Maps]]
+
 
 
==Introduction==
 
==Introduction==
  
Blogger at http://blogger.com is one of the most popular web blogging systems. To have a map inside the map would be cool, so in this article we will go thru the steps how to add Ovi Maps into your blog article.
+
Blogger at http://blogger.com is one of the most popular web blogging systems. To have a map inside a blog post would be cool, let's go through the steps of adding Nokia Maps to your blog post.
  
 
==Prerequisites==
 
==Prerequisites==
  
Ovi Maps API supported web browser (basically any modern web browser)  
+
Nokia Maps API supported web browser (basically any modern web browser)
  
 
A new or existing account at Blogger.com (http://blogger.com)
 
A new or existing account at Blogger.com (http://blogger.com)
 
  
 
==Implementation==
 
==Implementation==
Line 41: Line 43:
 
==Example code==
 
==Example code==
  
Follow these steps to add Ovi Maps into your blog:
+
Follow these steps to add Nokia Maps into your blog:
  
 
== STEP 1 ==
 
== STEP 1 ==
Line 49: Line 51:
 
Copy and paste the following code into the post ('Edit HTML code' mode)
 
Copy and paste the following code into the post ('Edit HTML code' mode)
  
<code java>
+
<code javascript>
  
<script src="http://api.maps.ovi.com/jsl.js" type="text/javascript" charset="utf-8"></script>
+
<script type="text/javascript" src="http://api.maps.nokia.com/2.0.0/jsl.js" charset="utf-8"></script>
 
<div id="map" style="width:400px; height:400px;">
 
<div id="map" style="width:400px; height:400px;">
 
</div>
 
</div>
 
<script type="text/javascript">
 
<script type="text/javascript">
var map = new ovi.mapsapi.map.Display(
+
var map = new nokia.maps.map.Display(
 
document.getElementById("map"),
 
document.getElementById("map"),
 
{
 
{
 
'zoomLevel': 10, //zoom level for the map
 
'zoomLevel': 10, //zoom level for the map
'center': [52.51, 13.4] //center coordinates
+
'center': [19.119, 72.8957] //center coordinates
 
}
 
}
 
);  
 
);  
Line 71: Line 73:
 
Note:  
 
Note:  
  
If you omit the zoom level value it will default to 0 (zero) and if you omit center, the coordinates will default to zero coordinates aswell (0,0).
+
If you omit the zoom level value it will default to 0 (zero) and if you omit center, the coordinates will default to zero coordinates as well (0,0).
  
 
You can edit the map properties and change e.g. the zoom level and map center.
 
You can edit the map properties and change e.g. the zoom level and map center.
  
==See the example live here==
+
==For more on Nokia Maps API==
  
http://ovimapsapi.blogspot.com/2011_05_10_archive.html
+
Please check out the Nokia Maps API full documentation and API reference here:
 +
* http://api.maps.nokia.com/
  
==For more on Ovi Maps API==
+
You may also access the interactive Nokia Maps API playground,
 
+
* http://api.maps.nokia.com/2.1.0/playground/index.html
Please check out the Ovi Maps API full documentation and API reference here:
+
 
+
http://api.maps.ovi.com
+
  
 
==Tested on==
 
==Tested on==
  
Google Chrome 11.0x
+
* Google Chrome 11.0x
 
+
* Mozilla Firefox 5.0
Mozilla Firefox 5.0
+

Revision as of 20:10, 12 January 2012

This article explains how to add a map to your blog post.

Article Metadata
Tested with
Devices(s): Google Chrome 11.0x, Mozilla Firefox 5.0
Dependencies: Nokia Maps 2.1.0
Article
Created: Maveric (20 Jun 2011)
Updated: avnee.nathani (12 Jan 2012)
Last edited: avnee.nathani (12 Jan 2012)


Contents

Introduction

Blogger at http://blogger.com is one of the most popular web blogging systems. To have a map inside a blog post would be cool, let's go through the steps of adding Nokia Maps to your blog post.

Prerequisites

Nokia Maps API supported web browser (basically any modern web browser)

A new or existing account at Blogger.com (http://blogger.com)

Implementation

We will create a new blog article using the online tools of Blogger. The example code will include the required HTML, JavaScript and styling needed to display the map. If needed, modify the paths and name of the file to suite your purposes.

Example code

Follow these steps to add Nokia Maps into your blog:

STEP 1

Open a new Blogger post editing window.

STEP 2

Copy and paste the following code into the post ('Edit HTML code' mode)

<script type="text/javascript" src="http://api.maps.nokia.com/2.0.0/jsl.js" charset="utf-8"></script>
<div id="map" style="width:400px; height:400px;">
</div>
<script type="text/javascript">
var map = new nokia.maps.map.Display(
document.getElementById("map"),
{
'zoomLevel': 10, //zoom level for the map
'center': [19.119, 72.8957] //center coordinates
}
);
</script>

STEP 3

Post it! - it's done!

Note:

If you omit the zoom level value it will default to 0 (zero) and if you omit center, the coordinates will default to zero coordinates as well (0,0).

You can edit the map properties and change e.g. the zoom level and map center.

For more on Nokia Maps API

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

You may also access the interactive Nokia Maps API playground,

Tested on

  • Google Chrome 11.0x
  • Mozilla Firefox 5.0
347 page views in the last 30 days.
×