-
Recently, I was working on the API of Google Map JS, and the project was completed, and I also found that the problem of memory overflow of marker and overlayview controlled by JS is very serious, and Google and Baidu both said that JS cannot implement the memory ** mechanism. Later, I looked at a lot of information, and reluctantly improved the performance, so I will share it with LZ, hoping it can be useful.
First, I will write in each onremove the operation of leaving all the variables of this layer empty, that is, =null, and then call the function collectgarbage() to free up memory However, this effect is not very obvious, and there are many theories on the Internet about the root cause. I summarized the following about this reason, there is a problem with the use of variables in js, we have var a variable in memory has always existed, so it can't be ***, especially for objects like obecjt, to null all the properties and methods of obeject objects can be really effective**, so it is the key to set null on variables in time when establishing lz and writing js.
Second, I changed the system of the machine, and found that the memory is much more stable, the original 03 is now replaced by windows7.
If you find anything lz, tell me in Baidu Hi and learn from each other.
-Seems to be off topic--
The marker should be written as a public variable, and the variables you define in AddListener should not be called from the outside, so you use setmap() like this, right?
-
mmarker annotates locations on the map. Use the method to add to the map.
Label objects include a point, which is the geographic location that the label anchors in the map, an icon, and an information window object that displays its description.
-
A lot of things still go to the official to see it, it's very simple.
-
Create several coordinates.
All coordinates. varlocations = newarray( ",",",", ",",",", ",",",", ",",",");
How to load the map.
functioninitialize() map = "map_canvas"), myoptions);Line settings.
varpolyoptions = poly = ;The loading cycle marks all the coordinates
-
Set a flag, remember the location, and count, and you're good to go.
-
There are several ways to do this:
1. Use the marker method to replace the icon with the small red dot icon, add the mouse through the action (mouseover), and change the marker icon ( when the mouse passes"");
2. Use HTML DOM to superimpose a layer of Dacha on the outside of the map, draw points on the corresponding coordinates of the map on the layer (here you need to convert latlng into pixels), and also add the mouse through the action.
3. Use the Rolling Eggplant to draw a circle (circle) method, draw a small red dot on the map to destroy the state, add an action, and then when the mouse passes;
The first method is the easiest, depending on what you need.
1.The Mazda key battery is CR1620, prepare a new battery in advance before replacing the battery. >>>More
Title Finishing Date.
1 December 3rd Birthday Book Love Luck Oceanbird 2000-09-01 >>>More
Summary. The beginning of spring in 1979 was February 4.
If the date you provide is the Gregorian calendar, he counts. >>>More
Song Dandan's several marriages were relatively unsuccessful, some of them started and ended quickly, because none of them were lovers, so they all ended up with a bad ending.
It's very simple, it's useless to use a special kill on the Golden Bridge at first, my approach is to keep grinding its HP with super heavy hits, especially when it picks up the ship, one super heavy blow is enough to knock the enemy and the ship into the air, of course, to avoid affecting the surrounding buildings on the way. >>>More