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 received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to