Gmail Calendar Documents Web Reader more »
Recently Visited Groups | Help | Sign in
Google Groups Home
removeAll or clear with GMarkerManager?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
zcox522@gmail.com  
View profile  
 More options Feb 21 2007, 4:31 am
From: "zcox...@gmail.com" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 15:31:43 -0000
Local: Wed, Feb 21 2007 4:31 am
Subject: removeAll or clear with GMarkerManager?
I have a large number of markers to display on a map so I want to use
GMarkerManager.  I see that it has addMarker and addMarkers methods,
but is there any way to remove markers from the manager?  Or is there
any way to "detach" a GMarkerManager from a map?  If so I'd just
detach the previous GMarkerManager and create a new one with the new
markers.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Williams  
View profile  
 More options Feb 21 2007, 5:25 am
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Wed, 21 Feb 2007 16:25:50 +0000
Local: Wed, Feb 21 2007 5:25 am
Subject: Re: removeAll or clear with GMarkerManager?
No there isn't.

--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
zcox522@gmail.com  
View profile  
 More options Feb 21 2007, 5:52 am
From: "zcox...@gmail.com" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 16:52:19 -0000
Local: Wed, Feb 21 2007 5:52 am
Subject: Re: removeAll or clear with GMarkerManager?
Would calling clearOverlays() on the map remove all of the markers
managed by the GMarkerManager?

On Feb 21, 11:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
zcox522@gmail.com  
View profile  
 More options Feb 21 2007, 5:51 am
From: "zcox...@gmail.com" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 16:51:21 -0000
Local: Wed, Feb 21 2007 5:51 am
Subject: Re: removeAll or clear with GMarkerManager?
Would calling clearOverlays() on the map remove all of the markers
managed by the GMarkerManager?

On Feb 21, 11:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Williams  
View profile  
 More options Feb 21 2007, 8:24 am
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Wed, 21 Feb 2007 19:24:25 +0000
Local: Wed, Feb 21 2007 8:24 am
Subject: Re: removeAll or clear with GMarkerManager?
Wasn't it zcox...@gmail.com who wrote:

>Would calling clearOverlays() on the map remove all of the markers
>managed by the GMarkerManager?

map.clearOverlays() removes the current display of the markers from the
map, but the data is still in the GMarkerManager's data, so the next
time it performs a manager.refresh() it puts them all back.

A manager.refresh() can happen if you call manager.refresh(), when the
zoom level changes, when the map pans far enough for a chunk (1024*1024
pixels) previously outside the [visible region plus borderPadding] comes
into view.

--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Cox  
View profile  
 More options Feb 21 2007, 8:29 am
From: "Zach Cox" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 14:29:31 -0500
Local: Wed, Feb 21 2007 8:29 am
Subject: Re: removeAll or clear with GMarkerManager?
Seems like GMarkerManager.clearMarkers() would be a useful method to
have in the API (for me at least :) ).

On 2/21/07, Mike Williams <nos...@econym.demon.co.uk> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dkann  
View profile  
 More options Feb 21 2007, 8:58 am
From: "dkann" <dkann...@gmail.com>
Date: Wed, 21 Feb 2007 19:58:54 -0000
Local: Wed, Feb 21 2007 8:58 am
Subject: Re: removeAll or clear with GMarkerManager?
You are not alone. Many developers have asked for that and hopefully
Google will provide it in the future releases of the API.

-dkann

On Feb 21, 2:29 pm, "Zach Cox" <zcox...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Cox  
View profile  
 More options Feb 21 2007, 9:03 am
From: "Zach Cox" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 15:03:59 -0500
Local: Wed, Feb 21 2007 9:03 am
Subject: Re: removeAll or clear with GMarkerManager?
Glad to know I'm not alone.  Have there been any clever hacks or
workarounds?  I only came up with two: 1) don't use GMarkerManager,
and 2) add all possible markers to the GMarkerManager.

On 2/21/07, dkann <dkann...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pamela (Google Employee)  
View profile  
 More options Feb 21 2007, 11:52 am
From: "pamela (Google Employee)" <api.pamela...@google.com>
Date: Wed, 21 Feb 2007 14:52:10 -0800
Local: Wed, Feb 21 2007 11:52 am
Subject: Re: removeAll or clear with GMarkerManager?
FYI - We're aware of the need for the additional functions, and
actively discussing it.
It seems to be one of top requested additions right now by this group.

On Feb 21, 12:03 pm, "Zach Cox" <zcox...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Cox  
View profile  
 More options Feb 21 2007, 12:08 pm
From: "Zach Cox" <zcox...@gmail.com>
Date: Wed, 21 Feb 2007 18:08:00 -0500
Subject: Re: removeAll or clear with GMarkerManager?
Thanks Pamela!  It's really nice to get feedback like that from the
Google Team - makes us feel loved!  :)

On 2/21/07, pamela (Google Employee) <api.pamela...@google.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pamela (Google Employee)  
View profile  
 More options Feb 21 2007, 12:11 pm
From: "pamela (Google Employee)" <api.pamela...@google.com>
Date: Wed, 21 Feb 2007 15:11:56 -0800
Local: Wed, Feb 21 2007 12:11 pm
Subject: Re: removeAll or clear with GMarkerManager?
<3

On Feb 21, 3:08 pm, "Zach Cox" <zcox...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Williams  
View profile  
 More options Feb 21 2007, 6:36 pm
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Thu, 22 Feb 2007 05:36:30 +0000
Local: Wed, Feb 21 2007 6:36 pm
Subject: Re: removeAll or clear with GMarkerManager?
Wasn't it Zach Cox who wrote:

>Glad to know I'm not alone.  Have there been any clever hacks or
>workarounds?  I only came up with two: 1) don't use GMarkerManager,
>and 2) add all possible markers to the GMarkerManager.

It's a really horrible hack, but if you're prepared to anchor yourself
to a particular API release, then you can kill an existing instance of
GMarkerManager by overwriting some of its critical Methods.

In APIv2.74 the two Methods that you need to clobber are
        manager.refresh() = function() {}
        manager.Ko() = function () {}
marker.Ko() is similar to marker.refresh(), but is called from within
the API when the zoom changes or the map pans sufficiently.

If you have two managers, and want to kill one of them, then you can
clear the overlays, clobber the managerOne.refresh() and
managerOne.Ko(), then use managerTwo.refresh() to bring back the markers
of managerTwo that were cleared by clearOverlays.

You can even resurrect a manager that you previously killed by grabbing
good copies of those critical Methods from another GMarkerManager, like
this:

    var unusedManager = new GMarkerManager(map);

    function killMarkers() {
        map.clearOverlays();
        manager.refresh = function() {};
        manager.Ko = function() {};
    }

    function resurectMarkers() {
        manager.refresh = unusedManager.refresh;
        manager.Ko = unusedManager.Ko;
        manager.refresh();
    }

The "Ko" name is an obfuscated function name with no exposed symbol, and
changes each time there's an API release.

        v2.74   Ko
        v2.73   Ho
        v2.72   wo

--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Cox  
View profile  
 More options Feb 22 2007, 1:36 am
From: "Zach Cox" <zcox...@gmail.com>
Date: Thu, 22 Feb 2007 07:36:54 -0500
Local: Thurs, Feb 22 2007 1:36 am
Subject: Re: removeAll or clear with GMarkerManager?
Nice work Mike!  I'll try that as a temporary workaround until we have
a GMarkerManager.clearMarkers() method.

On 2/22/07, Mike Williams <nos...@econym.demon.co.uk> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Burento  
View profile  
 More options Feb 22 2007, 8:58 pm
From: "Burento" <brent.aus...@gmail.com>
Date: Fri, 23 Feb 2007 07:58:24 -0000
Local: Thurs, Feb 22 2007 8:58 pm
Subject: Re: removeAll or clear with GMarkerManager?

I realize this isn't the best method to do this due to memory usage,
but until the "clearMarkers()" functionality is made, I've been making
due with this:

When I call map.clearOverlays() I also call a method that performs:
"mgr = new GMarkerManager(map);"

Like I said, not the best thing to do if you're using hundreds of
points, but for my purposes, it suffices.  I'm currently making
something similar to mapmyrun.com and http://www.usatf.org/routes/map/index.asp?
-- my trainer and I want a few different features than those utilized
by the aforementioned sites.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
barklund  
View profile  
 More options Apr 10 2007, 5:33 am
From: "barklund" <mor...@barklund.dk>
Date: Tue, 10 Apr 2007 09:33:25 -0700
Local: Tues, Apr 10 2007 5:33 am
Subject: Re: removeAll or clear with GMarkerManager?
Some time ago, I had the same problem. I ended up copying the
functionality from the "open" version via prototype into the current
version using the proper internal obfuscated variable names.

It looks a little messy, but it works.

http://www.barklund.org/blog/2007/03/27/google-maps-is-great-but-some...

--
Morten Barklund

On Feb 23, 9:58 am, "Burento" <brent.aus...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google