javascript - Remove all markers, polygons, and event listeners from a Google Map -


i have google map created google maps api 3 has several markers, polygons, , event listeners. when push button, want remove objects map, , have reload again nothing. there central function can reset or redraw map? seems should easy can't work.

if want turn on , off items should first collect them in arrays of objects , recursively should assigned each of these items value null map overlay's setmap() method in case yourobj.setmap(null);. turn them on reassign objects object map obj.setmap(map); note not remove objects. limited remove them map. permanently delete items need add assignment yourobj = null;


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -