Namespaces
Variants
Actions
(Difference between revisions)

HERE Maps API - Add a map into your Blogger post

Jump to: navigation, search
m (Maveric - - See the example live here)
m (Maveric - - STEP 3)
Line 47: Line 47:
 
Note:  
 
Note:  
  
If you omit the zoomLevel it will default to 0 (zero) and if you omit center, the coordinates will default to zero aswell.
+
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).
  
 
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.

Revision as of 19:06, 20 June 2011

Contents

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.

Prerequisites

Ovi 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 Ovi 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 src="http://api.maps.ovi.com/jsl.js" type="text/javascript" charset="utf-8"></script>
<div id="map" style="width:400px; height:400px;">
</div>
<script type="text/javascript">
var map = new ovi.mapsapi.map.Display(
document.getElementById("map"),
{
'zoomLevel': 10, //zoom level for the map
'center': [52.51, 13.4] //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 aswell (0,0).

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

See the example live here

http://ovimapsapi.blogspot.com/2011_05_10_archive.html

For more on Ovi Maps API

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

http://api.maps.ovi.com

Tested on

Google Chrome 11.0x

Mozilla Firefox 5.0

438 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved