dynamic proportions for polygon with zooming

11 views
Skip to first unread message

Marion Guthmuller

unread,
Dec 4, 2010, 5:31:40 AM12/4/10
to Tile5
Hi,

I'm trying to apply your tutorial to draw poly such as rectangle but i
am having some difficulties. I can draw rectangle with no problem but
i can't add a style. I have exactly the same code as the sample with
the external script styles.js but my rectangle is always white ... . I
would also like to know if we can have the same management zoom to
draw circles, that is to say that the size of the polygon increases or
decreases proportionally with the zoom level ?

Thank you in advance for your help !

Marion

Damon Oehlman

unread,
Dec 4, 2010, 7:59:30 AM12/4/10
to ti...@googlegroups.com
Hi Marion,

Is there somewhere you can post the code so I could take a look?

Sure we could definitely do something with circles as well.  I'm guessing the best way to specify the circle would be to specify the centre position (latitude and longitude) and then a radial distance (km).  This way the circle would be displayed correctly on any zoom level.  I'll have a look sometime next week and let you know.

Cheers,
Damon.
--
Damon Oehlman
http://distractable.net/

Marion Guthmuller

unread,
Dec 5, 2010, 10:59:15 AM12/5/10
to Tile5
It's okay, i resolved my problem. I wanted to draw a rectangle with
your new method Poly but i found another solution which works
perfectly ! I used the same syntax to draw circle with the function
placeMarker but i used the method from HTML5 context.fillRect instead
of context.arc. Here is my code :

return T5.ex(new T5.Marker(params), {
drawMarker: function(context, offset, x, y, state, overlay,
view) {
context.fillStyle = "rgba(30, 30, 30, 0.4)"
context.beginPath();
context.fillRect(
x,
y,
width,
height
);
}
});




On 4 déc, 13:59, Damon Oehlman <damon.oehl...@gmail.com> wrote:
> Hi Marion,
>
> Is there somewhere you can post the code so I could take a look?
>
> Sure we could definitely do something with circles as well.  I'm guessing
> the best way to specify the circle would be to specify the centre position
> (latitude and longitude) and then a radial distance (km).  This way the
> circle would be displayed correctly on any zoom level.  I'll have a look
> sometime next week and let you know.
>
> Cheers,
> Damon.
>
> On Sat, Dec 4, 2010 at 8:31 PM, Marion Guthmuller <
>
Reply all
Reply to author
Forward
0 new messages