Discussion Board

Results 1 to 2 of 2
  1. #1
    Nokia Developer Expert
    Join Date
    Jul 2013
    Posts
    4

    Red face cannot load kml file from my domain

    hi,

    i have upload several kml file on my domain, but i cannot open it using My API's

    kml.parseKML("http://indo-maps.com/kml/trying.kml");

    but when i trying to use the example API's which using for Here developer domain it can opened

    my kml link is :

    http://indo-maps.com/kml/trying.kml
    http://indo-maps.com/kml/MyPlace.kml
    http://indo-maps.com/kml/earthquakes.kml

    please need your support for this issue


    Best Regards

    Bayu

  2. #2
    Regular Contributor
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    289

    Re: cannot load kml file from my domain

    None of your links to the KML files works for me. They all give a 404 - file not found.

    If you are basing your work on the example, make sure that
    • You have removed the <base> command - so that the files are referenced from your webserver.
      Code:
      <base href="http://developer.here.com/apiexplorer/examples/api-for-js/data-visualization/display-data-on-map.html" >
    • The KML files are hosted on your webserver and available to JavaScript - if you can't do this you'll have to add a proxy to spoof the location




    The following snippet should work:
    Code:
    var kml = new nokia.maps.kml.Manager();
    var onParsed = function (kmlManager) {
    	var resultSet,
    		container,
    		boundingBox;
    
    	if (kmlManager.state == "finished") {
    		resultSet = new nokia.maps.kml.component.KMLResultSet(kmlManager, map);
    		resultSet.addObserver("state", function (resultSet) {
    			if (resultSet.state == "finished") {				
    				boundingBox = resultSet.container.getBoundingBox();
    				if (boundingBox) {
    					map.zoomTo(boundingBox);
    				}
    			}
    		});
    		map.objects.add(resultSet.create());
    	}
    };
    // Add an observer to KML manager
    kml.addObserver("state", onParsed);
    kml.parseKML("path_to_my_file/my_data.kml"); // This is the path to the KML file
    Last edited by jasfox; 2013-08-12 at 10:59.

Similar Threads

  1. cannot load the .qm file in Qt
    By mohamed gamal in forum Qt
    Replies: 3
    Last Post: 2010-10-13, 16:49
  2. Replies: 9
    Last Post: 2010-06-15, 21:30
  3. down load jar file
    By reshmy in forum Mobile Java General
    Replies: 5
    Last Post: 2008-10-20, 07:01
  4. Replies: 3
    Last Post: 2006-08-23, 00:05

Posting Permissions

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