Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Polygonzo 'Hello World' tutorial
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
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marko  
View profile  
 More options Nov 9, 12:31 am
From: Marko <marko.schi...@googlemail.com>
Date: Sun, 8 Nov 2009 05:31:02 -0800 (PST)
Local: Mon, Nov 9 2009 12:31 am
Subject: Polygonzo 'Hello World' tutorial
Good day,

I couldn't find any useful documentation about the Polygonzo utility
so I spent a while disassembling the provided complex example and want
to share my knowledge.

I created a simple "Hello World" page which you can find at
http://eurobilltracker.com/example/PG/hello_world.html

It generates a hundred rectangles and draws them on the map. The code
should be mostly self-explanatory.

Key concepts:

- Source data must be a JSON encoded array. Each element must contain
the following items: fillColor, fillOpacity, strokeColor,
strokeOpacity, strokeWidth, shapes

"shapes" itself is an array of points objects. Each element must be
named "points" and contain an array of coordinate pairs.

Example:

var mytest = {
"places": [
{"fillColor":color,
 "fillOpacity":"0.6",
 "strokeColor":"#000000",
 "strokeOpacity":"0",
 "strokeWidth":"0",
 "shapes":[{"points":[[y1,x1],[y2,x1],[y2,x2],[y1,x2]]}]}
  ]
 }

- Feed the "places" array to the Polygonzo constructor.

Example:

gonzo = new PolyGonzo.GOverlay({
   places: mytest.places,
   events: { }

});

map.addOverlay( gonzo );

I discovered it's a bad idea to create a few hundred Polygonzo
objects. ;-) Make sure to structure your source data accordingly
instead.

- Polygonzo doesn't work properly with IE8. You need to add the meta
tag to enforce IE7 mode for the time being.

<meta http-equiv="X-UA-Compatible" content="IE=7" />

Aside from that Polygonzo works smoothly with the latest browsers
(tested FF, Chrome, Opera and IE). A good choice to render hundreds of
shapes.

Hope this helps someone,
Marko


    Reply    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.
Davepar  
View profile  
 More options Nov 9, 4:40 am
From: Davepar <dualrud...@gmail.com>
Date: Sun, 8 Nov 2009 09:40:23 -0800 (PST)
Local: Mon, Nov 9 2009 4:40 am
Subject: Re: Polygonzo 'Hello World' tutorial
Nice work Marko. Maybe you could write to one of the project owners
and ask for permission to update the project wiki and add your
example?

What exactly is Polygonzo doing? It looks like it is creating an image
on the client from the JS data and then overlaying the image on Google
Maps?

Dave

On Nov 8, 5:31 am, Marko <marko.schi...@googlemail.com> wrote:


    Reply    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.
ernest  
View profile  
 More options Nov 11, 6:11 pm
From: ernest <erne...@gmail.com>
Date: Tue, 10 Nov 2009 23:11:51 -0800 (PST)
Local: Wed, Nov 11 2009 6:11 pm
Subject: Re: Polygonzo 'Hello World' tutorial
Hi Marko,
Both Michael and me created this small library a year ago for a
project we were working on based on Google Maps.
I have to give the credit here to the awesome skills from Michael to
make that happen.
Since then, we never found the time to make the modifications to make
the library easily reusable for other common scenarios.

To Davepar's question, Polygonzo uses canvas and vml to render complex
polygons on top of Google Maps. Another more popular library called
excanvas can do that too. However, polygonzo uses some tricks to
optimize the rendering performance specially on the VML part which is
used by IE.

Besides the obvious lack of documentation there were other essential
improvements in the wish list like decoupling the polygonzo class from
the polymap/testmap classes or using GeoJSON as the format for the
source data.

Maybe we'll find the time and energy to do some of those things
someday. In the meantime, as Davepar says, feel free to become a
member in the project. Just let me know.

Thanks,
Ernest

On Nov 8, 9:40 am, Davepar <dualrud...@gmail.com> wrote:


    Reply    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
©2009 Google