Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2013

    Is there GeoJSON support for Here Maps or any alternative to KML

    Is it possible to load GeoJson formatted data into here maps js api in a proper way? I am using AJAX to send data coming from mysql which is formatted in GeoJSON. I don't want to store any kml files.

  2. #2
    Nokia Developer Moderator
    Join Date
    Aug 2011

    Re: Is there GeoJSON support for Here Maps or any alternative to KML

    There is no GeoJson Parser in the API. You'll need to write your own. Taking the basis from an equivalent parser for Google maps, I've knocked up the following:


    The basic usage of the GeoJSONContainer is through the parseGeoJSON() method as follows:

    function extend(B, A) {
    	function I() {}
    	I.prototype = A.prototype;
    	B.prototype = new I();
    	B.prototype.constructor = B;
    function createGeoJsonParser(){
    	extend(GeoJSONContainer, nokia.maps.map.Container);
    	parser = new GeoJSONContainer();
    function parseJson(jsonObject){
    	result = parser.parseGeoJSON(jsonObject);	
    	if (parser.state == "finished") {
    		map.set("center", map.objects.get(0).getBoundingBox().getCenter());
    		map.addListener("click" ,  function(evt) {
    			var text = JSON.stringify(evt.target.properties);
    			bubble = infoBubbles.addBubble(text!== undefined ?   text : "properties undefined",
    		}, false);
    	} else {
    see: http://rawgithub.com/heremaps/exampl...json-data.html

    Since GeoJSONContainer is an extension of Container, you could also add the geoJSON data directly onto the map using addGeoJSON()

    var err = resultSet.addGeoJSON(jsonManager.object);
    if (resultSet.state == "finished") {
    	container.addListener("click" ,  function(evt) {
    	}, false);
    } else {
    Example Use: http://rawgithub.com/heremaps/exampl...sing-ajax.html

    you can alos add and style data points in the same manner as the clustering component

    It comes with no guarantees of course.
    Last edited by jasfox; 2013-09-04 at 13:41.

Similar Threads

  1. Ovi Maps API support for Mango
    By Maveric in forum Windows Phone General
    Replies: 17
    Last Post: 2012-03-26, 16:48
  2. alternative to ovi maps sdk
    By djpalshikar in forum [Closed] Publishing to Nokia Store
    Replies: 1
    Last Post: 2010-08-28, 06:32
  3. Looking for an alternative to Ovi Maps for Japan.
    By mattoruu in forum Geolocation and Navigation
    Replies: 4
    Last Post: 2009-09-06, 13:56
  4. Replies: 5
    Last Post: 2009-08-29, 16:12
  5. Replies: 1
    Last Post: 2009-05-25, 04:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts