Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Memory leak test</title>
- <script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU"></script>
- </head>
- <body>
- <input type="button" value="recalc" id="recalcBtn" />
- <div id="mapContainer" style="width: 400px; height: 400px;"></div>
- <script>
- var map;
- ymaps.ready(function() {
- map = new ymaps.Map("mapContainer", {
- center: [55.76, 37.64],
- zoom: 10
- });
- });
- (function() {
- var OBJECTS = 1000;
- document.getElementById("recalcBtn").onclick = function() {
- map.geoObjects.removeAll();
- for (var i = 0; i < OBJECTS; ++i) {
- map.geoObjects.add(new ymaps.Placemark([55.76 + i * 0.001, 37.64 + i * 0.001]));
- }
- }
- })();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement