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 8276811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:29:27+00:00 2026-06-08T08:29:27+00:00

I have some pretty large polygons (the xml file I use to generate them

  • 0

I have some pretty large polygons (the xml file I use to generate them is 400k and is just point data).

Once the user loads the polygons by clicking a button I store those polygons in an array.

var schoolDistPolygon = new google.maps.Polygon({
      paths: points,
      strokeColor: "#FF0000",
      strokeOpacity: 0.8,
      strokeWeight: 3,
      fillColor:color,
      fillOpacity: 0.35
    });
    schoolPolygons.push(schoolDistPolygon);

I then use this method toggle the polygons on on and off:

function toggleOverlays (the_array, mode){
   var arr = eval(the_array);
   if(mode=='hide'){
    for(i=0;i<arr.length;i++)
    {
        arr[i].setMap(null);

    }
         $("#schoolDistButton").bind('click',function(){toggleOverlays(the_array,'show')});
    }

       if(mode=='show'){
    for(i=0;i<arr.length;i++)
    {
        arr[i].setMap(map);

    }
         $("#schoolDistButton").bind('click',function(){toggleOverlays(the_array,'hide')});
    }


}

I’ve also tried just saving and setting the polygons edge and fill opacity to 0 instead of out right removing them but i get the exact same lag.

After the toggle button is clicked a few times there is extreme lag. and the browser crashes. This happens in chrome, firefox, ie, opera…all browsers I could get my hands on.

  • 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-06-08T08:29:29+00:00Added an answer on June 8, 2026 at 8:29 am

    You bind the click-event on every function-call, but previously bound clicks still exist.

    First unbind the click:

    $("#schoolDistButton").unbind('click')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is just some pretty standard code I have tried. What I am trying
Just writing some CSS and I have a pretty cool Search form where you
I have a pretty large test suite and I decorated some of the test_*
I have some large .png (.jpg, ...) files that require pretty much a full
I have some pretty large PNG images stored in a database (example 1000x15000 px,
I'm fairly new to Powershell and have written some pretty large scripts ie a
I have a pretty large form to develop and it could take some time
I have a pretty large file that I need to parse in php, so
I'm looking at building a Rails application which will have some pretty large tables
For some current projects, I'm working with several data structures that are pretty large

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.