Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance is extremely slow, browser is freezing, why? #179

Open
hoogw opened this issue May 5, 2021 · 5 comments
Open

Performance is extremely slow, browser is freezing, why? #179

hoogw opened this issue May 5, 2021 · 5 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@hoogw
Copy link

hoogw commented May 5, 2021

I add 200 labels, browser seems freezing, I click reload button, refresh button on browser menu, it reload after 10 seconds.
obviously 200 labels make browser not responsive.

any advise?

@hoogw
Copy link
Author

hoogw commented May 7, 2021

i know why is slow, 200 marker with lable generate 200 overlay views,

to make it fast, how can i make 200 lable share only one overlay view?

@hoogw
Copy link
Author

hoogw commented May 7, 2021

if i draw 200 lines, i can draw 200 line in one polyline, fast

if i draw 200 line use 200 new polyline object, it will be slow

@hoogw
Copy link
Author

hoogw commented May 7, 2021

what is the zIndex means?

                       `  var new_marker_label = new MarkerWithLabel({

                              icon: " ",  // an empty string will hide the icon, only shows labels   
                              
                              position: ___position,

                              clickable: false,  // must set false, otherwise, can not use mouse to pan map, due to this marker label shade, only trigger marker click-drag event, pan map event will not trigger
                              draggable: false,  // must set false, otherwise, can not use mouse to pan map, due to this marker label shade, only trigger marker click-drag event, pan map event will not trigger

                              zIndex: 0,   // does not help, we want to all label in one single overlay view, instead of each label for a seperate overlay view.
                                           // all label in a single over lay view, should have best performance, each label in a seperate overlay view will slow down performance 

                              map: map,

                              labelContent: "<div style='font-size:" + ___zoomScale[current_zoom] +  "px'>" + ____text + "</div>", // can also be HTMLElement

                              //labelAnchor: new google.maps.Point(-90, -45),   // make sure label at center of marker, must set anchor as offset,  
                              labelAnchor: new google.maps.Point(label_anchor_offset_vertical_y, label_anchor_offset_horizontal_x), 

                              labelClass: "labels", // the CSS class for the label
                              labelStyle: { opacity: ___opacity },  // opacity is NOT working, instead, you can set opacity statically in labelClass: "labels", // the CSS class for the label, color: rgba(0,0,0,0.5);  /*  label text color  */
                              visable: false

                          })`

@hoogw
Copy link
Author

hoogw commented May 7, 2021

I createa 200 label with 200 new_marker_label = new MarkerWithLabel({.....})

I believe this will create 200 labels with 200 seperated overlay view.

That result in very low performance.

I decide to set zIndex to a fixed number, such as 999.

try to make 200 label use single overlay view, to speed up performance, however, it is same result, very slow.

@jpoehnelt jpoehnelt added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels May 7, 2021
@Nicola-Widmer
Copy link

We are having an similar issue with about 80 labels at the exact same position. It loops through all labels stacking the next on top which causes 80 * 80 action calls. The whole process takes about 5 seconds to complete which causes a flickering of the markers.

@jpoehnelt jpoehnelt removed their assignment Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants