Try again with changes as added below in
green and skip those in
red The idea is that you only targetId the node whose child(s) you want to alter. Try this and report back, for I haven't studied the lot, just the most obvious.
Quote:
Has anyone successfully applied <Update> to <Model>?
I successfully updated (changed) a point in a placemark but I'm having challenges updating a model in a placemark.
Here's what I have so far:
doc2-load.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<Folder>
<name>model test</name>
<visibility>1</visibility>
<open>1</open>
<description>model update test</description>
<NetworkLink>
<name>Bus Network Link</name>
<visibility>1</visibility>
<open>1</open>
<refreshVisibility>0</refreshVisibility>
<Link>
<href>http://192.168.0.4/kml/doc2.kml</href>
</Link>
</NetworkLink>
</Folder>
</Document>
</kml>
doc2.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>doc2</name>
<open>1</open>
<Style id="sn_ylw-pushpin_copy0">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Style id="sh_ylw-pushpin_copy0">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<StyleMap id="msn_ylw-pushpin_copy0">
<Pair>
<key>normal</key>
<styleUrl>#sn_ylw-pushpin_copy0</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin_copy0</styleUrl>
</Pair>
</StyleMap>
<Style id="sn_ylw-pushpin">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<StyleMap id="msn_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin</styleUrl>
</Pair>
</StyleMap>
<Placemark id="Bus">
<name>Bus Model</name>
<styleUrl>#msn_ylw-pushpin_copy0</styleUrl>
<Model id="model_1">
<Location>
<longitude>-105.2819807268294</longitude>
<latitude>40.03631152655522</latitude>
<altitude>0</altitude>
</Location>
<Orientation id="orientation_model_1"> >
<heading>0</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<x>1</x>
<y>1</y>
<z>1</z>
</Scale>
<Link>
<href>http://192.168.0.4/kml/models/hop.dae</href>
</Link>
</Model>
</Placemark>
<Placemark>
<name>Untitled Placemark</name>
<LookAt>
<longitude>-105.2812472062487</longitude>
<latitude>40.03065749636099</latitude>
<altitude>0</altitude>
<range>2656.634578452202</range>
<tilt>69.56835621775275</tilt>
<heading>6.688056471642268</heading>
</LookAt>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Point>
<coordinates>-105.2819807268294,40.03631152655522,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
doc2-reload.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Update</name>
<Link>
<href>http://192.168.0.4/kml/doc2-update.kml</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>3</refreshInterval>
</Link>
</NetworkLink>
</kml>
doc2-update.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLinkControl>
<Update>
<targetHref>http://192.168.0.4/kml/doc2.kml</targetHref>
<Change>
<Model targetId="model_1">
<Orientation targetId="orientation_model_1"> >
<heading>90</heading>
<tilt>30</tilt>
<roll>60</roll>
</Orientation>
</Model>
</Change>
</Update>
</NetworkLinkControl>
</kml>
When I load up doc2-load.kml the model shows up where I expect, however when I load up doc2-reload.kml the model is unaffected.
Thanks