Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 774867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:11:58+00:00 2026-05-14T19:11:58+00:00

I’m using Google Maps in my Flex site to create a map. I’ve got

  • 0

I’m using Google Maps in my Flex site to create a map. I’ve got polygons overlayed on the map. When the user rolls over a polygon an infowindow opens identifying the area and the fill Alpha of the area is set to 0. On roll-out, the info window is removed and the fill Alpha is returned to the default, 0.2.

The polygons display and the InfoWindow is added and removed correctly. The problem is that the change in fill alpha only occurs on the very last polygon in the list. So for example, if I have polygons A, B, C, and D. If I rollover A, then A’s alpha should change. But, instead D’s alpha changes. No matter which polygon I rollover, the last polygon’s alpha changes. It’s weird, because the infoWindows behave correctly on rollover. So, if I rollover polygon A, the correct information for InfoWindow A appears.

Please see the code below:

private function allEncodedPolygons(event:MouseEvent) : void {
                var myPaneManager:IPaneManager = map.getPaneManager();
                var myMapPane:IPane = myPaneManager.createPane();



                if (allHoodsToggle.selected) { 

                    map.clearOverlays();
                    mapType.selectedIndex = -1;

                    for each (var neighbNode:XML in detailMapResultData){
                      outlinePolygon = this.createPoly(neighbNode);
                    map.addOverlay(outlinePolygon)};

                    allHoodsToggle.removeEventListener(MouseEvent.CLICK, allEncodedPolygons);


                }
               else {myPaneManager.clearOverlays(); allHoodsToggle.removeEventListener(MouseEvent.CLICK, allEncodedPolygons); 

                    }       


    }

The function below creates the polygons and has the rollover function:

private var neighbShapes:Polygon;

    private function createPoly(neighbNode:XML):Polygon {
        var optionsDefault:PolygonOptions = new PolygonOptions( { strokeStyle: {thickness: 5, color: 0xFFFF00, alpha: 0.4, pixelHinting: true}, fillStyle: { alpha: 0.2 }} ); 


        var neighbCenterLat:Number = neighbNode.latitudeCenter.toString(); 
        var neighbCenterLong:Number = neighbNode.longitudeCenter.toString(); 
        var neighbCenter:LatLng = new LatLng(neighbCenterLat,neighbCenterLong);
        var optionsHover:PolygonOptions = new PolygonOptions( { fillStyle: { alpha: 0.0 }} ); 
        var encodedData:EncodedPolylineData = new EncodedPolylineData(neighbNode.encoding.toString(), neighbNode.zoomFactor.toString(), neighbNode.level.toString(), neighbNode.numlevels.toString());
        var encodedList:Array = [encodedData];
        neighbShapes = Polygon.fromEncoded(encodedList, optionsDefault);

        neighbShapes.addEventListener(MapMouseEvent.CLICK, function(event:MapMouseEvent): void {
           map.openInfoWindow(event.latLng, new InfoWindowOptions({content: neighbNode.name.toString(), hasCloseButton:false, hasShadow:true}));
        });

        neighbShapes.addEventListener(MapMouseEvent.ROLL_OVER, function(event:MapMouseEvent): void {
            neighbShapes.setOptions(optionsHover);

            map.openInfoWindow(neighbCenter, new InfoWindowOptions({content: neighbNode.name.toString(), hasCloseButton:false, hasShadow:false})); 
        });

        neighbShapes.addEventListener(MapMouseEvent.ROLL_OUT, function(event:MapMouseEvent): void {
            neighbShapes.setOptions(optionsDefault); 
        });

         return neighbShapes;
    }

Any suggestions as to why the function that changes the alpha is firing on the last polygon only, even though the InfoWindow appears correctly? If anyone has any ideas, I’d love to hear them.

Thanks.

-Laxmidi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:11:59+00:00Added an answer on May 14, 2026 at 7:11 pm

    Okay, I figured it out. Instead of targetting neighbShapes to set the hover options, I should have used: event.currentTarget.setOptions(optionsHover);

    -Laxmidi

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 383k
  • Answers 383k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer MLSLABEL is (was?) a datatype used by Trusted Oracle, the… May 14, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer You can just use two where() methods. They will be… May 14, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer You don't need a custom TemplateProcessor to do this simple… May 14, 2026 at 10:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.