Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Markermanager, Markers not deleted...
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
  6 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
 
schlumsch  
View profile  
 More options Sep 11 2008, 9:55 am
From: schlumsch <schlum...@gmx.net>
Date: Thu, 11 Sep 2008 06:55:20 -0700 (PDT)
Local: Thurs, Sep 11 2008 9:55 am
Subject: Markermanager, Markers not deleted...
Hi all,

i`ve got 2 Problems with my GMap. Im using Java Server Faces and
Richfaces, my map is displayed in xhtml-file. Everything works fine,
the markermanager too, except the funcition clearMarkers() does not
remove all of my markers. Would be nice if someone can have a look at
my code.
Second Problem - can i delete a map and re-initialize it? I`d like to
display 2 maps on one page, or recreate a complete new map on the
first ones position. When i do so, my browser is loading my xhtml-file
endlessly. When i abort hte loading of the page and press F5 i got the
correct display.

Thanks a lot & lg schlumsch

        <rich:gmap id="gm2" lat="#{Bean.MAP_LATTIDUDE_INITIAL}"
lng="#{Bean.MAP_LONGTIDUDE_INITIAL}" zoom="#{Bean.MAP_ZOOM_INITIAL}"
gmapVar="map2"
         gmapKey="ABQIAAAAt7d08eLbEl8sARZc79uNIxRi_j0U6kJrkFvY4-
OX2XYmEAa76BQOIJMzNMrTMDjm_v0DPOkfQXL1tg"
          style="#{Bean.MAP_STYLE}" oninit="initializePoints()" />
          <script src="http://gmaps-utility-library.googlecode.com/svn/trunk/
markermanager/release/src/markermanager.js"></script>

                                <script type="text/javascript">
                                   //<![CDATA[
        var mgr;
         var baseIcon = new GIcon(G_DEFAULT_ICON);
        baseIcon.shadow = "http://www.schlumsch.eu/e2e/gmapicons/
shadow50.png";
        baseIcon.iconSize = new GSize(20, 34);
        baseIcon.shadowSize = new GSize(37, 34);
        baseIcon.iconAnchor = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);

        function clearMarkers() {
            mgr.removeMarker(marker);
        }

   function setCenter(lag, lat, zoom) {
  map2.setCenter(new GLatLng(lag, lat), zoom);
  var ulp = new GPoint(lag,lat);
 var ul = G_NORMAL_MAP.getProjection().fromPixelToLatLng(ulp,zoom);
  }

function createPoints(data) {
for (var i = 0; data.length; i++) {
var point = new GLatLng(data[i].latitude, data[i].longitude);
map2.setCenter(point);
map2.setZoom(16);
                                                        map2.addOverlay(createMarkerWithIdentifier(point, data[i].id,
data[i].beschreibung));

                                                }
        }

function createMarkerWithIdentifier(point, id, beschreibung) {
        mgr = new MarkerManager(map2, {trackMarkers:true});

  var nummer = id;
  var idIcon = new GIcon(baseIcon);
  idIcon.image = "http://www.schlumsch.eu/e2e/gmapicons/marker" + id +
".png";
    markerOptions = { icon:idIcon };
 var marker = new GMarker(point, markerOptions);
mgr.addMarker(marker);
 mgr.refresh();
  GEvent.addListener(marker, "click", function() {
  marker.openInfoWindowHtml(beschreibung);
         });
 GEvent.addListener(marker, "dblclick", function()
{ mgr.removeMarker(marker); } );

return marker;
                                        }

                                    //]]>
                                        </script>

                        <a4j:jsFunction name="initializePoints" data="#{Bean.hotels}"
                        oncomplete="createPoints(data)">
                        </a4j:jsFunction>

    <a href="javascript:void(0);" onclick="clearMarkers();return
false;"><font size="-2">alle loeschen</font></a>
   <br></br>


 
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.
geocodezip@gmail.com  
View profile  
 More options Sep 11 2008, 10:59 am
From: "geocode...@gmail.com" <geocode...@gmail.com>
Date: Thu, 11 Sep 2008 07:59:01 -0700 (PDT)
Local: Thurs, Sep 11 2008 10:59 am
Subject: Re: Markermanager, Markers not deleted...
On Sep 11, 6:55 am, schlumsch <schlum...@gmx.net> wrote:

> Hi all,

> i`ve got 2 Problems with my GMap. Im using Java Server Faces and
> Richfaces, my map is displayed in xhtml-file. Everything works fine,
> the markermanager too, except the funcition clearMarkers() does not
> remove all of my markers. Would be nice if someone can have a look at
> my code.
> Second Problem - can i delete a map and re-initialize it? I`d like to
> display 2 maps on one page, or recreate a complete new map on the
> first ones position. When i do so, my browser is loading my xhtml-file
> endlessly. When i abort hte loading of the page and press F5 i got the
> correct display.

> Thanks a lot & lg schlumsch

Please read the posting guidelines (post a link, not code):
http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...

 
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 Sep 11 2008, 11:11 am
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Thu, 11 Sep 2008 16:11:04 +0100
Local: Thurs, Sep 11 2008 11:11 am
Subject: Re: Markermanager, Markers not deleted...
Regarding your first problem:

The normal way to use MarkerManager is to have *one* MarkerManager
instance to which you add lots of markers. If you do it that way, then
you can write

function clearMarkers() {
  mgr.clearMarkers();

}

What your code does is create lots of MarkerManager instances, each of
which handle one marker. Your "mgr" variable is a reference to the last
MarkerManager that you created, so you can only make calls that affect
the marker that that MarkerManager manages.

--
http://econym.googlepages.com/index.htm
The Blackpool Community Church Javascript Team


 
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.
schlumsch  
View profile  
 More options Sep 12 2008, 7:36 am
From: schlumsch <schlum...@gmx.net>
Date: Fri, 12 Sep 2008 04:36:41 -0700 (PDT)
Local: Fri, Sep 12 2008 7:36 am
Subject: Re: Markermanager, Markers not deleted...
Well, i`m sorry but i dont have the possibility to link my code now.
So i have to post some code again.

When i define gmarkers and mgr global, no marker is shown on the map,
error: map2 is not defined.
When i define both in a function, for example in createpoints, no
error is produced but also no marker shown :)

 var mgr = new MarkerManager(map2);

                var markerlist = [];

                function createPoints(data) {

                                                        for (var i = 0; data.length; i++) {
                                                        var point = new GLatLng(data[i].latitude, data[i].longitude);
                                                        map2.setCenter(point);
                                                        map2.setZoom(16);
                                                        map2.addOverlay(createMarkerWithIdentifier(point, data[i].id,
data[i].beschreibung));

                                                }
                                                mgr.addMarkers(markerlist);
                                                mgr.refresh;
                                        }

                                        function createMarkerWithIdentifier(point, id, beschreibung) {

                              var nummer = id;
                      var idIcon = new GIcon(baseIcon);
                      idIcon.image = "http://www.schlumsch.eu/e2e/
gmapicons/marker" + id + ".png";
                      markerOptions = { icon:idIcon };
                                          var marker = new GMarker(point, markerOptions);
                                          GEvent.addListener(marker, "click", function() {
                                            marker.openInfoWindowHtml(beschreibung);
                                          });
                                          GEvent.addListener(marker, "dblclick", function()
{ mgr.removeMarker(marker); } );
                                                markerlist.push(marker);

                                          return marker;
                                        }


 
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.
Ralph Ames  
View profile  
 More options Sep 12 2008, 2:30 pm
From: Ralph Ames <ralph.a...@gmail.com>
Date: Fri, 12 Sep 2008 21:30:38 +0300
Local: Fri, Sep 12 2008 2:30 pm
Subject: RE: Markermanager, Markers not deleted...

>Well, i`m sorry but i dont have the possibility to link my code now.
>So i have to post some code again.

Please follow the posting guidelines and give a link to your map page.

Ralph

www.easypagez.com/maps/map_index.html
-


 
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.
schlumsch  
View profile  
 More options Sep 15 2008, 4:22 am
From: schlumsch <schlum...@gmx.net>
Date: Mon, 15 Sep 2008 01:22:49 -0700 (PDT)
Local: Mon, Sep 15 2008 4:22 am
Subject: Re: Markermanager, Markers not deleted...
So, can anybody tell me how to modify the above given code (sorry
again)? Even when i create lots of markermanagers like in my first
posting, the delete-link is not working. (should kill the last one) O
only the listener for doubleklick works fine...

thx & lg schlumsch

On 12 Sep., 20:30, Ralph Ames <ralph.a...@gmail.com> wrote:


 
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 »