circular sector with polygons

628 views
Skip to first unread message

Radicz

unread,
Aug 26, 2010, 5:00:34 PM8/26/10
to Google Maps JavaScript API v3
Hi everyone, sorry for my English.

I need help to create circular sector with polygons. I found this
http://pastebin.com/f3b2cdea8, but I have no idea how it works or how
to integrate it into my cource code. Could someone please advise me?
Thanks for any answers

My source code

var PoleBodu = [
['Spartakiádní', 50.68504754096478,
13.990276157855988, ..........,null],
['Dukelských hrdinů', 50.683881737055, 13.998518586158752,.......,
null]
];

function initialize()
{
var Nastaveni = {
zoom: 12,
center: new google.maps.LatLng(50.68681982238762,
14.000144215759285),
mapTypeId: google.maps.MapTypeId.ROADMAP
}

map = new google.maps.Map(document.getElementById("mapa"),
Nastaveni);
InfoOkno = new google.maps.InfoWindow({maxWidth:350});

for (var i = 0; i < PoleBodu.length; i++)
{
VytvorBody(PoleBodu[i]);
}
}


function VytvorBody(PoleBod)
{
var icona = new google.maps.MarkerImage(PoleBod[5], new
google.maps.Size(39, 47), new google.maps.Point(0,0), new
google.maps.Point(0, 33));
var stin = new google.maps.MarkerImage(PoleBod[6], new
google.maps.Size(35, 35), new google.maps.Point(0,0), new
google.maps.Point(-5, 27));
var klikarena = {coord: [0,0,40,40],type: 'rect'};

var pozice = new google.maps.LatLng(PoleBod[1], PoleBod[2]);
var bod = new google.maps.Marker({
position: pozice,
map: map,
name: PoleBod[0],
shadow: stin,
/*icon: icona, */
shape: klikarena,
zIndex: PoleBod[3]
});

PoleBod[7] = bod;

google.maps.event.addListener(bod, 'click', function()
{
InfoOkno.close();
VytvorInfoOkno(InfoOkno, map, this, PoleBod);
$("#tabs").tabs();
OzariProstor(2000, map, bod, PoleBod);
});

}

function OzariProstor(radius, map, bod) //funkce tvorici polygon
{
if(!bod.highlighted)
{
bod.highlighted = true;
var circle = new google.maps.Circle({
map: map,
radius: radius,
fillColor: "#B43116",
strokeWeight:2,
strokeColor:"#7D0A05"
});
circle.bindTo('center', bod, 'position');
}
}

function VytvorInfoOkno(InfoOkno, where, which, PoleBod)
{
if (PoleBod[7] == which )
{
InfoOkno.setContent(PoleBod[4]);
InfoOkno.open(where, which);
}
}


geoco...@gmail.com

unread,
Aug 26, 2010, 5:46:11 PM8/26/10
to Google Maps JavaScript API v3
On Aug 26, 2:00 pm, Radicz <r4d...@gmail.com> wrote:
> Hi everyone, sorry for my English.
>
> I need help to create circular sector with polygons. I found thishttp://pastebin.com/f3b2cdea8, but I have no idea how it works or how
> to integrate it into my cource code. Could someone please advise me?
> Thanks for any answers

I'm not sure what you are trying to accomplish. Please post a link to
your map rather than code:
http://groups.google.com/group/google-maps-js-api-v3/t/2b3f101fd509919e?hl=en

This may help:
http://www.geocodezip.com/v3_polyline_example_arc.html

-- Larry
> }- Hide quoted text -
>
> - Show quoted text -

Radicz

unread,
Aug 26, 2010, 8:23:29 PM8/26/10
to Google Maps JavaScript API v3
I trying to make a map for the Internet provider and I want to click
on Mark show coverage from the antenna. Omnidirectional antennas are
easy, because it is an ordinary circle. To directional antennas but I
need a circular sector. Unfortunately, I do not know how to do it.

Link on map http://178.77.202.130/mapa/

On 26 srp, 23:46, "geocode...@gmail.com" <geocode...@gmail.com> wrote:
> On Aug 26, 2:00 pm, Radicz <r4d...@gmail.com> wrote:
>
> > Hi everyone, sorry for my English.
>
> > I need help to create circular sector with polygons. I found thishttp://pastebin.com/f3b2cdea8, but I have no idea how it works or how
> > to integrate it into my cource code. Could someone please advise me?
> > Thanks for any answers
>
> I'm not sure what you are trying to accomplish. Please post a link to
> your map rather than code:http://groups.google.com/group/google-maps-js-api-v3/t/2b3f101fd50991...
>
> This may help:http://www.geocodezip.com/v3_polyline_example_arc.html
>
>   -- Larry
>
>
>
> > My source code
>
> > var PoleBodu = [
> >   ['Spartakiádní', 50.68504754096478,
> > 13.990276157855988, ..........,null],
> >   ['Dukelských hrdinù', 50.683881737055, 13.998518586158752,.......,

Rossko

unread,
Aug 26, 2010, 8:31:17 PM8/26/10
to Google Maps JavaScript API v3
> I trying to make a map for the Internet provider and I want to click
> on Mark show coverage from the antenna. Omnidirectional antennas are
> easy, because it is an ordinary circle. To directional antennas but I
> need a circular sector. Unfortunately, I do not know how to do it.

What information do you have to work with?
To define a circle, you'd have the centre point (mast) and a radius
(range) I guess.
What do you have to work out your sectors ; radius, centre , and ...?

Radicz

unread,
Aug 26, 2010, 9:12:10 PM8/26/10
to Google Maps JavaScript API v3
I'm sorry, I hope I translated correctly your answer.
"> What do you have to work out your sectors ; radius, centre ,
and ...?" I think the direction where the antenna shows.
I know what the coordinates of the antenna is located. I know its
broadcasting angle and know which direction the antenna points. I do
not know if it's enough to create a circular sector

geoco...@gmail.com

unread,
Aug 26, 2010, 9:12:14 PM8/26/10
to Google Maps JavaScript API v3
On Aug 26, 5:23 pm, Radicz <r4d...@gmail.com> wrote:
> I trying to make a map for the Internet provider and I want to click
> on Mark show coverage from the antenna. Omnidirectional antennas are
> easy, because it is an ordinary circle. To directional antennas but I
> need a circular sector. Unfortunately, I do not know how to do it.

What do you mean by a circular sector? A pie shape? If I recall
correctly directional antennas have an asymetrical dumbell shape for
their coverage. If that is what you need, you will need to dig up an
equation for it.

-- Larry

>
> Link on maphttp://178.77.202.130/mapa/
> > > - Show quoted text -- Hide quoted text -

Radicz

unread,
Aug 26, 2010, 9:19:20 PM8/26/10
to Google Maps JavaScript API v3
Yes I think it is a pie shape. Coverage is to be informational only.
The equation for the creation of the sector should be here
http://en.wikipedia.org/wiki/Circular_sector

Radicz

unread,
Aug 26, 2010, 9:29:52 PM8/26/10
to Google Maps JavaScript API v3
This site has it. Clicking on any mark displayed Sector
http://www.amigonet.cz/lokality/pokryto/ul

On 27 srp, 03:19, Radicz <r4d...@gmail.com> wrote:
> Yes I think it is a pie shape. Coverage is to be informational only.
> The equation for the creation of the sector should be herehttp://en.wikipedia.org/wiki/Circular_sector

geoco...@gmail.com

unread,
Aug 26, 2010, 9:55:19 PM8/26/10
to Google Maps JavaScript API v3
On Aug 26, 6:29 pm, Radicz <r4d...@gmail.com> wrote:
> This site has it. Clicking on any mark displayed Sectorhttp://www.amigonet.cz/lokality/pokryto/ul

Did you see the green polyline on this example from my first post:
http://www.geocodezip.com/v3_polyline_example_arc.html

I think that does what you want. You can combine the pieces into a
polygon.

-- Larry

geoco...@gmail.com

unread,
Aug 26, 2010, 10:14:56 PM8/26/10
to Google Maps JavaScript API v3
On Aug 26, 6:55 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Aug 26, 6:29 pm, Radicz <r4d...@gmail.com> wrote:
>
> > This site has it. Clicking on any mark displayed Sectorhttp://www.amigonet.cz/lokality/pokryto/ul
>
> Did you see the green polyline on this example from my first post:http://www.geocodezip.com/v3_polyline_example_arc.html
>
> I think that does what you want.  You can combine the pieces into a
> polygon.
This might make it clearer:
http://www.geocodezip.com/v3_polygon_example_arc.html

Radicz

unread,
Aug 27, 2010, 5:42:10 AM8/27/10
to Google Maps JavaScript API v3
It is the perfect thank you very much

Radicz

unread,
Aug 28, 2010, 10:06:26 AM8/28/10
to Google Maps JavaScript API v3
Hi again everyone.
I have a little problem with the circle pie. When you try to make a
pie down. It does this http://178.77.202.130/pokus/ . Could someone
help me please?

Rossko

unread,
Aug 28, 2010, 12:08:43 PM8/28/10
to Google Maps JavaScript API v3
> I have a little problem with the circle pie. When you try to make a
> pie down. It does thishttp://178.77.202.130/pokus/. Could someone
> help me please?

Swap your start and end points

Radicz

unread,
Aug 28, 2010, 12:15:34 PM8/28/10
to Google Maps JavaScript API v3
Unfortunately it did not work

geoco...@gmail.com

unread,
Aug 28, 2010, 1:13:41 PM8/28/10
to Google Maps JavaScript API v3
Wasn't quite that simple. The algorithm didn't handle the -180 point
well.

http://www.geocodezip.com/v3_polygon_example_arcs.html

-- Larry

Radicz

unread,
Aug 29, 2010, 7:34:02 AM8/29/10
to Google Maps JavaScript API v3
thank you very much
Reply all
Reply to author
Forward
0 new messages