Getting a KMZ to open in the API

111 views
Skip to first unread message

MaskMan469

unread,
Oct 5, 2011, 5:39:59 PM10/5/11
to KML Developer Support - KML Server Side Scripting
OK I had this working before but moved to another webpage and it is
not working, here goes:

I have a complex KML's that has calls to embedded KMZ overlays that
are to open in the browser API.

These KMZ's open as intended inside the GE client and I had these
links working on an another test server running the API, now that I
have moved these KML to our server they no longer work correctly.

They try to open the GE Client instead of in the browser API.

I have a feeling that the issue is with the MIME settings, however, I
cannot find the proper setting to get the thing to open in the
browser. Before setting up the MIME settings for the GE client it was
going to a page a cannot be displayed. Now they try to open the
client
with what I could find on the Google Earth website. I cannot find
any
info for the settings in the API area and on the website I had it
working on before, the owner has let it laps and cannot get a hold of
them.

If this is not the right forum, I can move it.

Any thoughts or ideas on what is going on?

Thanks!

Josh L

unread,
Oct 17, 2011, 11:58:27 PM10/17/11
to KML Developer Support - KML Server Side Scripting
Hey sorry for the delay; you probably want to have posted this in the
Earth API forum.  That said, what is your API code you are trying to
load the KMZ's with?  And are you able to share the url to one of the
KMZ's currently online?
Cheers,
  -Josh

MaskMan469

unread,
Oct 19, 2011, 11:50:07 AM10/19/11
to KML Developer Support - KML Server Side Scripting
Hi Josh,

Thanks for the reply, I have posted in our Earth Enterprise forum as
well as a couple of others to no avail.

I do not have a url as this is internal running on Enterprise, I can
see if I can post external. At one time all this was working on an
external Maps API but do not have access to that server any longer.

As for the code it is rather simple href to a kmz from within a kml
that is open in the API already. The kml is opened from a interactive
checkbox. The kmz is a standard ground overlay that is being called
from a link in an info bubble.

Open KML call:
<Placemark>
<name>R-61.2</name>
<Snippet maxLines="2"></Snippet>
<description><![CDATA[<table border=1 style="border-collapse:collapse;
border-color:#000000;" cellpadding=0 cellspacing=0 width=269><tr><td
align="center"> <font COLOR="#008000"><a href="http://d4web/d4-surveys/
sv04row-w/00061/00061/ge_disclaimer_overlay.jpg.sid">Open Archived
Map</a></font></td></tr><tr><td bgcolor="#E4E6CA" align="center">
<font COLOR="#008000"><a href="http://d4web/d4-surveys/sv04row-w/
00061/00061/kmzs/r_00061_001_sn-02175.KMZ">Open Spatial Exhibit Map</
a></font></td></tr><tr><td bgcolor="#E4E6CA" align="center"> <font
COLOR="#008000"><a href="http://d4web/d4-surveys/sv04row-w/
googleerrorrecords.htm">Report an Error</a></font></td></tr></
table>]]></description>

This is a bit truncated, however, it shows the two calls we are doing
from the info bubble. The second one is the KMZ. The SID call works
fine. Inside that kmz are PNG for regioning as well as a doc.kml that
uses the ground overlay command:

<Folder>
<name><![CDATA[ r_00061_001_sn-02175_L1_0_0 ]]></name>
<Region>
<LatLonAltBox>
<north>37.77373679366516500</north>
<south>37.76844350957281900</south>
<east>-122.41851430553706000</east>
<west>-122.42516326439294000</west>
</LatLonAltBox>
<Lod>
<minLodPixels>43</minLodPixels>
<maxLodPixels>-1</maxLodPixels>
</Lod>
</Region>
<GroundOverlay>
<drawOrder>1</drawOrder>
<Icon>
<href><![CDATA[ r_00061_001_sn-02175_L1_0_0.PNG ]]></href>
</Icon>
<LatLonBox>
<north>37.77373679366516500</north>
<south>37.76844350957281900</south>
<east>-122.41851430553706000</east>
<west>-122.42516326439294000</west>
</LatLonBox>
</GroundOverlay>

and so on...

I am playing with perhaps using <fetchkml> inside of the kml bubble as
on this page I have an interactive fetch kml/kmz that does do exactly
what I want:

var kmlUrlField = new Ext.form.TriggerField({
fieldLabel: 'Add KML/KMZ',
triggerClass: 'x-form-search-trigger',
anchor: '100%',
name: 'url',
value: 'http://',
selectOnFocus: true,
scope: this,
onTriggerClick: function(){
google.earth.fetchKml(this.scope.earth,
this.getValue(), this.scope.addKml.createDelegate(this.scope));
this.reset();
},
listeners: {specialkey: {fn: function(f, e){
if (e.getKey() == e.ENTER) {
this.onTriggerClick();
}
}}}
});

However, this works on a ontrigger button, not an href call from
within a kml. Not really sure how to do that.

Thanks
Reply all
Reply to author
Forward
0 new messages