innerBoundaryIs in Maps

1,425 views
Skip to first unread message

Jerry F

unread,
Jul 31, 2010, 12:57:30 PM7/31/10
to KML Developer Support - Advanced Support for KML
It seems that, while Google Earth supports innerBoundaryIs to draw a
cutout inside
a Polygon, and the resulting overlay leaves the cutout uncolored.

However, Google Maps does not seem to support this. This kml is a copy
of a documented sample, translated to the lat-long of my interest, but
otherwise unchanged.

http://mystormrisk.com/all-kml/sample-inner.kml

It displays as advertised in Earth, but simply creates a second
boundary line along
the inner boundary, without leaving the cutout uncolored.

Am I right? Are there plans to support this in Maps?
Have I stupidly missed something in the spec that makes it fly in
Maps?
Is it maps v3 issue?

Should I redirect this to some other group?

Thanks, folks.

Maarten L

unread,
Jul 31, 2010, 6:49:22 PM7/31/10
to KML Developer Support - Advanced Support for KML
As can be read on http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html,
inner boundaries are supported in Google Maps. Your kml shows as
intended when I load it into Maps in Firefox, but not in Safari or
Chrome (on Mac). The support for inner boundaries in Google Maps says
that it is 'implicitly from <LinearRing> order', so according to the
documentation, your kml should show fine. Could be a maps v3 issue, I
think...

Rossko

unread,
Aug 1, 2010, 5:15:52 AM8/1/10
to KML Developer Support - Advanced Support for KML
> Have I stupidly missed something in the spec that makes it fly in
> Maps?

I don't think so, but there are some subtleties at work here

http://code.google.com/apis/kml/documentation/kmlreference.html#polygon
points out that polygon coords should be ordered counterclockwise.
I think both your inner and our bounds are indeed ccw.

However ... the different rendering technologies used in different
browsers use different rules to determine what is a hole in a polygon
http://econym.org.uk/gmap/chrome.htm#winding

Be worth trying ordering your inner coords clockwise ... might then
work in Chrome but not in FF/IE ?!? Whichever maps KML parser you
are using may or may not be smart enough to sort it out for the
relevant browser.

Jerry F

unread,
Aug 1, 2010, 8:45:08 AM8/1/10
to KML Developer Support - Advanced Support for KML
Thanks to you both!

It sure enough does work, given Firefox. And I appreciate the tip on
the winding link.

On Jul 31, 5:49 pm, Maarten L wrote:
> Your kml shows as
> intended when I load it into Maps in Firefox, but not in Safari or
> Chrome (on Mac).

On Aug 1, 4:15 am, Rossko wrote:
> I don't think so, but there are some subtleties at work here
>    http://econym.org.uk/gmap/chrome.htm#winding

Jerry F

unread,
Aug 1, 2010, 11:40:22 AM8/1/10
to KML Developer Support - Advanced Support for KML
Just to follow up with a very tight focus, the link Rossko
gave points to this page, which gives a tester for a browser's
ability to render holes:
http://econym.org.uk/gmap/example_polyhole.htm

On Aug 1, 7:45 am, Jerry F wrote:
> Thanks to you both!
>

Again.

Rossko

unread,
Aug 1, 2010, 12:37:21 PM8/1/10
to KML Developer Support - Advanced Support for KML
> a tester for a browser's
> ability to render holes:
>  http://econym.org.uk/gmap/example_polyhole.htm

Just to expand a bit, that tester renders a holey polygon 'direct'
from the maps API. Not using KML - it remains up to the developer to
handle browser quirks.

Differences in the way a browser's graphic renderers work _ought_ to
be hidden by a KML parser/renderer.
(The Maps API standard KML parser is a bit special - it runs at
Google's severs, not the client - so that might be a technical
challenge for Google.)

I still think it may be a cross-browser bug in Google's maps API
kmllayer service, but that's a matter to bring up at
http://groups.google.com/group/google-maps-js-api-v3/
with your example KML

TheCompWiz

unread,
Sep 12, 2011, 11:16:08 AM9/12/11
to kml-suppor...@googlegroups.com
Did you make any head-way on this? ... I'm running into the exact same issue.  

You can see the page here using the google maps API:

Most (if not all) of the cut-outs are filled in... and some are doubled-up as if I had two polygons stacked on top of each other.

If you download the KMZ directly and open them in google earth... 0 issues.
A4 F4 M3 M6 R5 S3


TheCompWiz

unread,
Sep 12, 2011, 11:17:38 AM9/12/11
to kml-suppor...@googlegroups.com
Forgot to mentinon... the cutouts fail on ALL browsers... (IE, Chrome, FF, Safari, etc...)

Brendan Kenny

unread,
Sep 19, 2011, 6:55:52 PM9/19/11
to KML Developer Support - Advanced Support for KML
Hi,

Trying a few of your KMZ files, I'm seeing the same rendering in
Firefox and Chrome as in Earth (with plenty of cut-outs).

With that said, if you can reliably replicate the problem, you should
bring it up in the Maps API v2 group (which is what you're using for
your maps, it appears). You'll probably find more answers there, and
advice if you need to file a bug report.

Cheers,
Brendan

TheCompWiz

unread,
Sep 19, 2011, 7:53:28 PM9/19/11
to kml-suppor...@googlegroups.com
Well... thanks for responding, but the issue was solved using a bunch of dirty hacks.  In essence, I removed all "innerBoundaryIs" elements by slicing up the polygons into multiple polygons without any holes in them.  You can still see the problems persist on the "A4" and "F4" files.  (compare with what's in the full map on http://www.wrga.gov/node/585.  You are correct that I'm stuck using the v2 api... but I couldn't find the "Maps API v2" group.  I would still like to see this work without resorting to cutting up my polygons into a bunch of smaller ones... but as they say... the show must go on.  For the A4 & F4 maps... I created a test page for all to look at.   http://www.wrga.gov/node/586
Reply all
Reply to author
Forward
0 new messages