Domanda

This problem has only cropped up recently, but I couldn't find any reference to google changing anything relevant.

I have a site where I want to display Just the name of a region on the map when it is clicked on, and not in the hideous default style <name> is always displayed in.

So, in the <BalloonStyle><text> add $[description], and in <description> add CDATA $[name]

This works well in google maps, and up until not long ago, worked well in my google maps.

Now (when they are clickable) my polygons show the huge name, followed by $[name] or $[description] if there's nothing in <description>.

Some of the interior of balloon (from view selection source): <div jstcache="0" style="font-weight: bold; font-size: medium; margin-bottom: 0em;" torrens_rural_catchment=""> Torrens Rural Catchment </div> <div jstcache="0" id="iw_kml"><div jstcache="0">$[name]</div></div>

And! One of my polygons is completely invisible, but clickable! (perfectly visible in earth)

I'm completely lost as to why this has started happening. I can't think of anything I've done to the code to affect it.

site: http://wds.amlr.waterdata.com.au/Amlr.aspx (click near underneath the green area for invisible polygon. also, site not finished)

using Shabdar's Google Maps Control for ASP.NET

all kmz are under 30 kb

please help!


"<description> HTML content is allowed but is sanitized to protect from cross-browser attacks; entity replacements of the form $[dataName] are unsupported." ok, fair enough, how do i display just the name (preferably in small text)? it's always breaking!

kml detail: google earth shows just the name in small text, maps shows the large name and description text below it.

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
    <Document>
    <name>Fleurieu_Peninsula_Catchment.kml</name>
    <StyleMap id="default1">
    <Pair>
    <key>normal</key>
    <styleUrl>#default</styleUrl>
    </Pair>
    <Pair>
    <key>highlight</key>
     <styleUrl>#default0</styleUrl>
    </Pair>
</StyleMap>
<Style id="default">
    <IconStyle>
        <scale>0.7</scale>
    </IconStyle>
    <LabelStyle>
        <color>00ffffff</color>
    </LabelStyle>
    <BalloonStyle>
        <text><![CDATA[$[name]]]></text>
    </BalloonStyle>
    <LineStyle>
        <width>0.5</width>
        <color>cc94c934</color>
    </LineStyle>
    <PolyStyle>
        <color>7fffc24f</color>
        <outline>0</outline>
    </PolyStyle>
</Style>
<Style id="default0">
    <IconStyle>
        <scale>0.7</scale>
    </IconStyle>
    <LabelStyle>
        <color>00ffffff</color>
    </LabelStyle>
    <BalloonStyle>
        <text><![CDATA[$[name]]]></text>
    </BalloonStyle>
    <LineStyle>
        <width>0.5</width>
        <color>cc94c934</color>
    </LineStyle>
    <PolyStyle>
        <color>7fffc24f</color>
        <outline>0</outline>
    </PolyStyle>
</Style>
<Placemark id="p2">
    <name>Fleurieu Peninsula Catchment</name>
    <snippet maxLines="0"></snippet>
    <description>Don't show this</description>
    <styleUrl>#default1</styleUrl>
    <Polygon>
        <outerBoundaryIs>
            <LinearRing>
                <coordinates>
                    138.585914080646,-35.3888737733775,0 138.58279412306,-35.3890538078642,0 138.578014195374,-35.3898638645537,0 138.574064275831,-35.3919539205289,0 138.57115435005,-35.3942239666534,0 ...
    </coordinates>
    </LinearRing>
    </outerBoundaryIs>
    </Polygon>
    </Placemark>
    </Document>
    </kml>

when I refresh the page the kml is no longer clickable.

has google changed the way it interprets these things recently?

È stato utile?

Soluzione

D:

Ok. After a lot of stuffing around, here's what happened.

Google must have enforced

"<description> HTML content is allowed but is sanitized to protect from cross-browser attacks; entity replacements of the form $[dataName] are unsupported."

which broke what I was doing in the infowindows before. Now I've removed <BalloonStyle> and <name> and only show the name in the <description> tag (with styling inc. padding-top:20px;), which gives me nice, small text.

The "no more than five kmls" rule happened, which didn't just stop rendering kmls, it broke things: One kml didn't show up, but was still clickable with its infowindow, and some visible kmls sometimes weren't clickable on refresh.

I've used the validator here http://www.kmlvalidator.org/ on all my kmls, which all validate.

Except! When I save them to kmz format through Google Earth (v6.2.2.6613) google removes consecutive <innderBoubdaryIs> tags from within <Polygon> so that there's only one <innderBoubdaryIs> tag surrounding all<LinearRing> tags. This causes only the first <innderBoubdaryIs><LinearRing> tag to create a hole in the polygon, and ignores the rest. (Hmm... do I need to bring this to someone in particular's attention? or will an update fix this? )

So, I'm off to go compress all my kmls myself.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top