Google Groups Home
Help | Sign in
Donut polygons filled inside out
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Klaas  
View profile
 More options Aug 20, 3:06 pm
From: Klaas <k...@orange.nl>
Date: Wed, 20 Aug 2008 03:06:16 -0700 (PDT)
Local: Wed, Aug 20 2008 3:06 pm
Subject: Donut polygons filled inside out
Hello,

I'm trying to make encoded polygons with donuts (islands / holes) in
it.
In Google Earth (non-encoded points and levels) it is drawn well and
looks like this:
www.gisdro.nl/DONUT/Donut.kml

But when I encode the polygons and use this in Google Maps it looks
like this:
www.gisdro.nl/DONUT/

I use this piece of code:

new GPolygon.fromEncoded({
  polylines: [
    {points: "urp~H{m}\
\rG_GW}@hNsMpQ{HgE_MeFhD{GfA_GoBmA_AeCaDaB_EmAiE_Pwy@{AaF{CgFqCsCaFeCsB[oQZ }Co@aE{BLlUd@bFr@`ApD|
I~GzMf@lCJrD\
\vCTDtBpCt@hB^jCVjJnBpL`@fMhApBv@`CFnBKnEV`Ch@jB`C`Ff@xBGFRxAvX{JiRo~@D_@iJ cl@[KcI`FAf@`AlFf@x@jBhKXfCJ|
Dr@`G^j@fBt@@b@jGyD",
     levels:
"PCCEFHCFCAGACECBGBDDBIBEABDBADABFACCDACABDACAAIGCABHBFBACAAFBBEP",
     color: "#FFFFFF",
     opacity: 1,
     weight: 2,
     numLevels: 18,
     zoomFactor: 2},
    {points: "urp~H{m}\
\rG_GW}@hNsMpQ{HgE_MeFhD{GfA_GoBmA_AeCaDaB_EmAiE_Pwy@{AaF{CgFqCsCaFeCsB[oQZ }Co@aE{BLlUd@bFr@`ApD|
I~GzMf@lCJrD\
\vCTDtBpCt@hB^jCVjJnBpL`@fMhApBv@`CFnBKnEV`Ch@jB`C`Ff@xBGFRxAvX{J",
     levels: "PCCEFHCFCAGACECBGBDDBJBEABDBADABFACCDACABDACAAGP",
     color: "#FFFFFF",
     opacity: 1,
     weight: 2,
     numLevels: 18,
     zoomFactor: 2}],
  fill: true,
  color: "#FF0000",
  opacity: 0.7,
  outline: true

});

It makes no diffference when I change the order of the polygons.
The polygons are drawn well seperately, so no issue with the encoding.
What's going wrong?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelo  
View profile
 More options Aug 20, 3:51 pm
From: marcelo <marcelo...@hotmail.com>
Date: Wed, 20 Aug 2008 03:51:52 -0700 (PDT)
Local: Wed, Aug 20 2008 3:51 pm
Subject: Re: Donut polygons filled inside out
A 'donut' is 3D body, and I don't think you can draw that on a 2D
map.
You can only do something flat, like this:
http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/examplePo...

What part of the polygon do you want to be hollow? (I cannot run
Google Earth due to hardware issues).
There seems to be a line connecting the outer white ring with the
inner red block, which I believe should not be there.

--
Marcelo - http://maps.forum.nu
--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaas  
View profile
 More options Aug 20, 3:59 pm
From: Klaas <k...@orange.nl>
Date: Wed, 20 Aug 2008 03:59:02 -0700 (PDT)
Local: Wed, Aug 20 2008 3:59 pm
Subject: Re: Donut polygons filled inside out
Well, maybe 'donut' is not the good word... I mean a hole in a
polygon, exactly the way the Pentagon-example at facstaff shows.
I my example the transparent part (with that strange line in it)
should be red and the red part transparant (the hole).

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelo  
View profile
 More options Aug 20, 4:33 pm
From: marcelo <marcelo...@hotmail.com>
Date: Wed, 20 Aug 2008 04:33:53 -0700 (PDT)
Local: Wed, Aug 20 2008 4:33 pm
Subject: Re: Donut polygons filled inside out
On Aug 20, 12:59 pm, Klaas <k...@orange.nl> wrote:

> Well, maybe 'donut' is not the good word... I mean a hole in a
> polygon, exactly the way the Pentagon-example at facstaff shows.
> I my example the transparent part (with that strange line in it)
> should be red and the red part transparant (the hole).

In that case, the first polygon is drawn wrong.
If you show the first polygon alone, you get the hole in the middle
because the polyline goes around it, (that's why you have the
crossline connecting the inner and outer ring). In fact, the two
polygons do not overlap.
That connecting line as well as the inner ring should not be there.
The first polygon should be only the outer perimeter, and then the API
will substract them.

--
Marcelo - http://maps.forum.nu
--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaas  
View profile
 More options Aug 20, 7:36 pm
From: Klaas <k...@orange.nl>
Date: Wed, 20 Aug 2008 07:36:49 -0700 (PDT)
Local: Wed, Aug 20 2008 7:36 pm
Subject: Re: Donut polygons filled inside out
Yes, you are right. At encoding it pushes the points of every polygon
in an array. But I didn't empty the array when it loops to the next
polygon. That's why the points of the first polygon are in the next
polygon too. Problem solved now, thanks for giving it a look, Marcelo!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google