ThinkGeo.com    |     Documentation    |     Premium Support

'Attaching' lines/polygons/etc. to moving features

I have a custom point style I use for vehicles, which are pointshapes w/ an icon. This custom style allows the vehicles to rotate on the map. These vehicles will be moving a lot.

What I would like to do is be able to do things like: have a circle appear around the vehicle, have polygons attached to the vehicle, etc. This is supposed to represent sonar.

Below is a very bad drawing of what I mean:

The black square is the vehicle pointing north at a heading 0. Let’s say I have an input of 200 and 60. This would mean I want the red polygon shape to go 200 meters out from the vehicle, covering 60 degrees.

The next picture would be the same thing, except I would have an input of 200 and 360, indicating the red circle goes 200 meters out from the vehicle, covering 360 degrees.

I hope this makes sense of what I’m trying to accomplish. These attached shapes would move w/ the vehicle.

Hi Dan,

If you want to dynamic draw the circle or the sector area with your vehicle, I have to say that’s not easy, because it also related with the rotation.

My suggestion is you can design many types of the icon image, one of them is just the vehicle, the other one is a circle out of vehicle, and another one is the sector with vehicle. When you need to use one of them you can easily replace the icon image.

If you have to build that by code, please try to build a special point style, and then draw the point in the other layer with the new style, which will looks like the effect you want.

Regards,

Ethan