Here is an example of how this moving can be done...
public function setCenter(latLng : LatLngBounds) : void
{
// this funciton is only for testing, it will be replaced,
// polygons stored in the team member vo will store a polygon
// that can be changed when they change their view!
map.setCenter(latLng.getCenter());
if (polygon == null)
{
polygon = new Polygon([
latLng.getNorthWest(),
latLng.getSouthWest(),
latLng.getSouthEast(),
latLng.getNorthEast(),
latLng.getNorthWest()],
new PolygonOptions({
strokeStyle: new StrokeStyle({
color: 0x0000ff,
thickness: 4,
alpha: 0.7}),
fillStyle: new FillStyle({
color: 0x0000ff,
alpha: 0.5})
}));
map.addOverlay(polygon);
}
else
{
polygon.setPolyline(0,
[
latLng.getNorthWest(),
latLng.getSouthWest(),
latLng.getSouthEast(),
latLng.getNorthEast(),
latLng.getNorthWest()]);
}
}
You need to remember to store the polygon somewhere (it doesn't have to be in the class with the map)...
No comments:
Post a Comment