GEORSS feed and kml file network link do not work in embedded map

68 views
Skip to first unread message

Ron White

unread,
Nov 14, 2011, 2:12:49 PM11/14/11
to google-map...@googlegroups.com
I have been working on this for weeks now.  I have live data that I want to display in an embedded Google Map.  I have a kml file that has a network link.  This kml file works perfectly in Google Earth.  It also works perfectly if I go to Google Maps and paste the link.  It does not work if embedded into my web page.  Originally, I was trying to use a kml file with multiple network links.  I wanted to show several layers and give the user the ability to turn on/off layers.  But I gave up on that and now I am just trying to display 1 network link.

I have tried:
1. Using the iframe code created by the Google Maps web page and then changing the source to a variable.  This does actually work, but I can't get it to zoom to the area I want and I don't think it is possible to turn layers on/off.

2.  Creating a new google.maps.map and adding a kml file (this doesn't work at all):
       var map = new google.maps.Map(document.getElementById("GMAP"), myOptions);
       var kmlLayer = new google.maps.KmlLayer('http://wwww.usahas.com/ge/kml/RouteOnly/vr025.kml',
       {  suppressInfoWindows: true, map: map});

3.  I also tried this (works, but won't zoom and doesn't work with API V3 at all):
        geoXMLArea = new GGeoXML("http://wwww.usahas.com/ge/kml/RouteOnly/vr025.kml"
        map = new GMap2(document.getElementById('GMAP'));
        map.setCenter(new GLatLng(40,-99), 3);
        map.setMapType(G_HYBRID_MAP);
       
        map.addControl(new GLargeMapControl());
        map.addControl(new GScaleControl());
        map.addControl(new GMapTypeControl());
       
        map.addOverlay(geoXMLArea);

4.  Finally, I tried a GEORSS feed.  This also works in Google Maps but not in my web page.
         var georssLayer = new google.maps.KmlLayer('http://www.usahas.com/SpatialDisplay/GEORSSFeed.ashx?route=vr025&month=11&day=14&    hour=16');
            georssLayer.setMap(map); 

Before this, I haven't done any work with Google Maps.  I usually do everything in Google Earth.  But in this case, I can't use Google Earth.  I am surprised at how much more difficult Google Maps is to work with.

Thanks for any help, I sure need it.
Ron

Joseph Elfelt

unread,
Nov 14, 2011, 3:41:21 PM11/14/11
to Google Maps JavaScript API v3
I tried to display the file in your network link using some
development code that I am working on.
My code could read the file headers OK but the map remained blank.
Most likely reasons:
1. That KML file exceeds Google's 3 MB limit
or
2. The API timed out waiting for the file.

Someone in the forum here determined that the API will time out after
4 seconds.
You might try putting that file up on Google Sites.
If it displays from there, then you have a time-out issue.

Also, you might try changing your href tag to say & instead of &

geoco...@gmail.com

unread,
Nov 14, 2011, 4:12:40 PM11/14/11
to Google Maps JavaScript API v3
It works with geoxml3 in v3 (and with KmlLayer):

http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/Get_GE_VR025_kml.xml

If I save it to my local server. Don't know why it doesn't work from
yours.

-- Larry



>
> 4.  Finally, I tried a GEORSS feed.  This also works in Google Maps but not
> in my web page.
>          var georssLayer = new
> google.maps.KmlLayer('http://www.usahas.com/SpatialDisplay/GEORSSFeed.ashx?route=vr025&mont...
Reply all
Reply to author
Forward
0 new messages