×
Namespaces

Variants
Actions
(Difference between revisions)

HERE Maps API - Add a map into your Blogger post

From Nokia Developer Wiki
Jump to: navigation, search
jasfox (Talk | contribs)
m (Jasfox - App id)
jasfox (Talk | contribs)
m (Jasfox - link)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Nokia Maps]][[Category:Code Snippet]][[Category:JavaScript]][[Category:Browser]]
+
[[Category:HERE Maps]][[Category:Code Snippet]][[Category:JavaScript]][[Category:Browser]]
 
{{Abstract|This article explains how to add a map to your blog post. }}
 
{{Abstract|This article explains how to add a map to your blog post. }}
{{ArticleMetaData
+
{{ArticleMetaData <!-- v1.2 -->
 
|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=Google Chrome, Mozilla Firefox, Internet Explorer, Opera
+
|devices= Google Chrome, Mozilla Firefox, Internet Explorer, Opera
 
|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= Web Browser
 
|platform= Web Browser
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
|dependencies=Nokia Maps 2.2.3
+
|dependencies= HERE Maps 2.5.3
|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. -->
|keywords= Blog, Blogger, Wordpress, Nokia Maps, JavaScript
+
|keywords= Blog, Blogger, Wordpress, HERE Maps, JavaScript
|id= <!-- Article Id (Knowledge base articles only) -->
+
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|translated-by= <!-- [[User:XXXX]] -->
 
|translated-by= <!-- [[User:XXXX]] -->
|translated-from-title= <!-- Title only -->  
+
|translated-from-title= <!-- Title only -->
 
|translated-from-id= <!-- Id of translated revision -->
 
|translated-from-id= <!-- Id of translated revision -->
|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=[[User:avnee.nathani]]
+
|update-by= [[User:avnee.nathani]]
 
|update-timestamp= 20120112
 
|update-timestamp= 20120112
|creationdate=20110620
+
|creationdate= 20110620
|author=[[User:Maveric]]
+
|author= [[User:Maveric]]
 
}}
 
}}
 
{{SeeAlso|
 
{{SeeAlso|
* [http://developer.here.net/javascript_api Nokia Maps API]
+
* [http://developer.here.net/javascript_api HERE Maps API]
 +
* [http://heremaps.github.io/examples/index.html HERE Maps on Github]
 
* [http://developer.here.net/apiexplorer/examples/api-for-js/getting-started/basic-map-with-components.html Basic Map Example]
 
* [http://developer.here.net/apiexplorer/examples/api-for-js/getting-started/basic-map-with-components.html Basic Map Example]
* [http://www.vicchi.org/2012/04/17/two-wordpress-plugins-and-the-missing-nokia-map/  Word Press Plugins for Nokia Maps]
+
* [http://www.vicchi.org/2012/04/17/two-wordpress-plugins-and-the-missing-nokia-map/  Word Press Plugins for HERE Maps]
 
  }}
 
  }}
  
 
== Word Press Plugins  ==
 
== Word Press Plugins  ==
A pair of  [http://wordpress.org/ WordPress] plugins have been created  [http://www.vicchi.org/2012/04/17/two-wordpress-plugins-and-the-missing-nokia-map/  here] specifically to handle adding Nokia Maps on their website:
+
A pair of  [http://wordpress.org/ WordPress] plugins have been created  [http://www.vicchi.org/2012/04/17/two-wordpress-plugins-and-the-missing-nokia-map/  here] specifically to handle adding HERE Maps on their website:
 
*  [http://wordpress.org/extend/plugins/wp-nokia-auth/ Word Press Nokia Map credentials Plugin]  
 
*  [http://wordpress.org/extend/plugins/wp-nokia-auth/ Word Press Nokia Map credentials Plugin]  
 
*  [http://wordpress.org/extend/plugins/wp-quadratum/ Word Press Foursquare Nokia Map Plugin]  
 
*  [http://wordpress.org/extend/plugins/wp-quadratum/ Word Press Foursquare Nokia Map Plugin]  
* [https://github.com/vicchi/wp-nokia-auth Word Press Nokia Map credentials]  
+
* [https://github.com/vicchi/wp-nokia-auth Word Press Nokia Map credentials]  
 
* [https://github.com/vicchi/wp-quadratum Word Press Foursquare Nokia Map Code]  
 
* [https://github.com/vicchi/wp-quadratum Word Press Foursquare Nokia Map Code]  
  
Line 43: Line 43:
 
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.
 
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.
  
Follow these steps to add Nokia Maps into your blog:
+
Follow these steps to add HERE Maps into your blog:
  
 
'''STEP 1''' Open a new Blogger post editing window.  
 
'''STEP 1''' Open a new Blogger post editing window.  
  
 
'''STEP 2''' Copy and paste the following code into the post ('Edit HTML code' mode). Remember to add in your own [[How to Obtain Your Own Nokia appID and Token| AppId and Token]].
 
'''STEP 2''' Copy and paste the following code into the post ('Edit HTML code' mode). Remember to add in your own [[How to Obtain Your Own Nokia appID and Token| AppId and Token]].
<code javascript>
+
<code html5>
  
<script type="text/javascript" src="http://api.maps.nokia.com/2.2.3/jsl.js" charset="utf-8">
+
<script type="text/javascript" src="http://js.api.here.com/se/2.5.3/jsl.js" charset="utf-8">
 
<div id="map" style="width:400px; height:400px;">
 
<div id="map" style="width:400px; height:400px;">
 
<script type="text/javascript">
 
<script type="text/javascript">
// Don't forget to set your API credentials
+
// Don't forget to set your API credentials
nokia.Settings.set( "appId", "YOUR APP ID GOES HERE");  
+
          nokia.Settings.set("app_id", "YOUR APP ID");  
nokia.Settings.set( "authenticationToken", "YOUR AUTHENTICATION TOKEN GOES HERE");
+
          nokia.Settings.set("app_code", "YOUR TOKEN");
  
var map = new nokia.maps.map.Display(
+
var map = new nokia.maps.map.Display(document.getElementById("mapContainer"),{
document.getElementById("mapContainer"),
+
'zoomLevel': 10, //zoom level for the map
{
+
'center': [19.119, 72.8957] //center coordinates}
'zoomLevel': 10, //zoom level for the map
+
);  
'center': [19.119, 72.8957] //center coordinates
+
}
+
);  
+
 
</script>
 
</script>
  
Line 75: Line 72:
 
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.
  
==For more on the Nokia Maps API==
+
==For more on the HERE Maps API==
  
Please check out the Nokia Maps API full documentation and API reference here:
+
Please check out the HERE Maps API full documentation and API reference here:
* [http://developer.here.net/javascript_api Nokia Maps API]
+
* [http://developer.here.com/javascript_api HERE Maps API]
  
 
You may also access the interactive API explorer
 
You may also access the interactive API explorer
* [http://developer.here.net/javascript_api_explorer API explorer]
+
* [http://developer.here.com/javascript_api_explorer API explorer]

Latest revision as of 18:12, 20 December 2013

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

Article Metadata
Tested with
Devices(s): Google Chrome, Mozilla Firefox, Internet Explorer, Opera
Compatibility
Platform(s): Web Browser
Dependencies: HERE Maps 2.5.3
Article
Keywords: Blog, Blogger, Wordpress, HERE Maps, JavaScript
Created: Maveric (20 Jun 2011)
Updated: avnee.nathani (12 Jan 2012)
Last edited: jasfox (20 Dec 2013)

[edit] Word Press Plugins

A pair of WordPress plugins have been created here specifically to handle adding HERE Maps on their website:

[edit] Blogger

Blogger at http://blogger.com is a popular web blogging system. Here are the required steps for adding a Nokia Map to your blog post.

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.

Follow these steps to add HERE 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). Remember to add in your own AppId and Token.

<script type="text/javascript" src="http://js.api.here.com/se/2.5.3/jsl.js" charset="utf-8">
<div id="map" style="width:400px; height:400px;">
<script type="text/javascript">
// Don't forget to set your API credentials
nokia.Settings.set("app_id", "YOUR APP ID");
nokia.Settings.set("app_code", "YOUR TOKEN");
 
var map = new nokia.maps.map.Display(document.getElementById("mapContainer"),{
'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.

[edit] 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

This page was last modified on 20 December 2013, at 18:12.
224 page views in the last 30 days.