Re: Number Limit on Custom Icons
Rossko...
The first kml file below is loaded when the check box is clicked.
There is a network link within it that references the data in the
second kml file.
http://www.cnrfc.noaa.gov/data/kml/0hour_temp.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<NetworkLink id="ID">
<name>Current Hour Temperatures</name>
<description><![CDATA[Temperature Summary <br><a href="http://
www.cnrfc.noaa.gov/awipsProducts/RNOFSTTMP.php">Text Product</a>]]></
description>
<Link>
<href>http://www.cnrfc.noaa.gov/data/kml/0hour_temp_data.kml</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>600</refreshInterval>
</Link>
</NetworkLink>
</kml>
http://www.cnrfc.noaa.gov/data/kml/0hour_temp_data.kml (There are a
lot more placemarks in my file... just wanted to show how they appear
by showing one of them).
<Folder>
<ScreenOverlay>
<name>NOAA Logo</name>
<Icon>
<href>http://www.cnrfc.noaa.gov/data/icons/logos/noaalow1trans.png</
href>
</Icon>
<overlayXY x="-130" y="66" xunits="pixels" yunits="pixels"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
<size x="-1" y="-1" xunits="fraction" yunits="fraction"/>
</ScreenOverlay>
<ScreenOverlay>
<name>NWS Logo</name>
<Icon>
<href>http://www.cnrfc.noaa.gov/data/icons/logos/
nwslogoredletters.png</href>
</Icon>
<overlayXY x="-192" y="62" xunits="pixels" yunits="pixels"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
<size x="-1" y="-1" xunits="fraction" yunits="fraction"/>
</ScreenOverlay>
<Placemark id="ENV">
<name></name>
<Style><LabelStyle><scale>0</scale></LabelStyle><description><![CDATA
[<table width="300"><tr><td><span style="font-size: 11pt; font-family:
Arial, Helvetica, sans-serif; font-weight: bold; color:
#003399;"><b>Wendover (ENV)</b></span><br><span style="font-size:
10pt; font-family: Arial, Helvetica, sans-serif; font-weight: normal;
color: #003399;">Latitude:
40.72°N Longitude:
114.04°W<br>Elevation: 4237 Ft</span><br><hr><i>Temperature For
10/04/09 10 AM PDT</i><br><b>44 °F</b> (6.6 °C)</
td></tr></table>]]></description><IconStyle><scale>1</
scale><Icon><href>http://www.cnrfc.noaa.gov/data/icons/temp_icons/
44.png</href></Icon><hotSpot x="17" y="0" xunits="pixels"
yunits="pixels"></hotSpot></IconStyle></
Style><Point><coordinates>-114.03586,40.72055</coordinates></Point>
</Placemark>
</Folder>
Here is the code I am using to load the kml once clicked using
GGeoXml...
function toggleKML1(checked, id) {
if(checked== true) {
var geoXml = new GGeoXml(kml[id].url, function() {
if (geoXml.loadedCorrectly()) {
var center= geoXml.getDefaultCenter();
var zoom = map.getZoom();
kml[id].center = center;
kml[id].zoom = zoom;
}
});
kml[id].obj = geoXml;
map.addOverlay(kml[id].obj);
}
else {
map.removeOverlay(kml[id].obj );
}
}
Here is the code I tried with GeoXml...
function toggleKML1(checked, id) {
if(checked== true) {
geoXml = new google.maps.GeoXml(kml[id].url);
map.addOverlay(geoXml);
}
else {
map.removeOverlay(geoXml);
}
}
Here is the code that loads the map...
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.950, -119.2500), 5);
map.addControl(new GLargeMapControl());
map.enableScrollWheelZoom();
map.enableDoubleClickZoom();
map.enableContinuousZoom();
map.setMapType(G_PHYSICAL_MAP);
map.addMapType(G_PHYSICAL_MAP);
var hierarchy = new GHierarchicalMapTypeControl();
hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels",
true);
map.addControl(hierarchy);
map.addControl(new GScaleControl());
removeAll();
}
}
Thanks a bunch for looking at this... Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home