Thank u very much Helen!!! I've already got what I want :>
I've just pickup actionscript 3.0 like 2 weeks ago and my programming
skill is terrible! Haha.
Sorry for giving you so much trouble all along. T.T

On Sep 2, 10:58 pm, helen <[email protected]> wrote:
> Chingu,
> You can only ever have one info window open at a time. To have your
> labels persist and remain attached to a point on the map you need to
> add them as overlays as I described previously:
>
> 1 - copy Pamela's TooltipOverlay class, rename it to LabelOverlay if
> the "Tooltip" part is throwing you off. You might also want to change
> the positionOverlay method depending on where you want your labels to
> sit relative to themarker(Pamela has them right in the centre). For
> example, to have the labels centred directly below the markers:
>         this.textField.x = point.x - this.textField.width / 2;
>         this.textField.y = point.y;
>
> 2 - add themarkerandlabeloverlays like this:
>           var latlng:LatLng = new LatLng(x,y);
>           varmarker:Marker= newMarker(latlng, new MarkerOptions
> (...));
>           map.addOverlay(marker);
>           varlabel:String = "Lat: " + x + " Lng: " + y;
>           map.addOverlay(new LabelOverlay(latlng,label));
>
> That's it.
>
> Helen
>
> On Sep 2, 4:51 am, Chingu <[email protected]> wrote:
>
> > Hi Helen it works for themarkerlabel. I do it in this way.
>
> > varmarker:Marker= newMarker(new LatLng( 0.12345, 0.2468 ),new
> > MarkerOptions({hasShadow: false, icon: new boot, draggable: true}));
> > map.addOverlay(marker);
>
> > map.openInfoWindow(new LatLng( 0.12345, 0.2468 ), new InfoWindowOptions
> > ({content: "Lat: 0.12345 Lng: 0.2468", width: 80, height: 50,
> > tailHeight: 0}));
> > --------------------------------------------------------------------------------------
> > I'm still left with one more thing. The codes above can only show one
> >markerlabeland I have a few markers on the map so I put it in this
> > way which I have no idea why it can't appear the othermarkerlabel.
>
> > //marker1
> > varmarker:Marker= newMarker(new LatLng( 0.12345, 0.2468 ),new
> > MarkerOptions({hasShadow: false, icon: new boot, draggable: true}));
> > map.addOverlay(marker);
>
> > map.openInfoWindow(new LatLng( 0.12345, 0.2468 ), new InfoWindowOptions
> > ({content: "Lat: 0.12345 Lng: 0.2468", width: 80, height: 50,
> > tailHeight: 0}));
>
> > //marker2
> > var marker2:Marker= newMarker(new LatLng( 0.4325, 0.25125 ),new
> > MarkerOptions({hasShadow: false, icon: new boot, draggable: true}));
> > map.addOverlay(marker2);
>
> > map.openInfoWindow(new LatLng( 0.4325, 0.25125 ), new InfoWindowOptions
> > ({content: "Lat: 0.4325 Lng:  0.25125", width: 80, height: 50,
> > tailHeight: 0}));
>
> > Please advice.
>
> > On Aug 28, 9:33 pm, helen <[email protected]> wrote:
>
> > > Chingu,
> > > I guess I didn't explain it clearly enough. You can use exactly the
> > > same type of custom overlay as Pamela's example but instead of having
> > > listeners to add and remove it on mouseover and mouseout, you add it
> > > once at the same time as you add themarker. If you need to remove 
> > > themarker, you can remove the custom overlay at the same time too. I have
> > > edited Pamela's onMapReady function below to demonstrate.
>
> > >     private function onMapReady(event:Event):void {
> > >         map.setCenter(new LatLng(37.4419, -122.1419), 13,
> > > MapType.NORMAL_MAP_TYPE);
>
> > >         // Add 5 markers to the map at random locations
> > >          var bounds:LatLngBounds = map.getLatLngBounds();
> > >         var southWest:LatLng = bounds.getSouthWest();
> > >         var northEast:LatLng = bounds.getNorthEast();
> > >         var lngSpan:Number = northEast.lng() - southWest.lng();
> > >         var latSpan:Number = northEast.lat() - southWest.lat();
> > >         for (var i:Number = 0; i < 5; i++) {
> > >             var latlng:LatLng = new LatLng(southWest.lat() + latSpan *
> > > Math.random(),
> > >                                      southWest.lng() + lngSpan *
> > > Math.random());
> > >             map.addOverlay(newMarker(latlng));
> > >             map.addOverlay(new TooltipOverlay(latlng, latlng.toString
> > > ()));
> > >         }
> > >     }
>
> > > Note that I have moved this discussion back to the group so that
> > > others who may have the same question can see the full conversation.
> > > Please use the "Reply" link, not "Reply to author" unless you really
> > > need to move it offline.
>
> > > On Thu, Aug 27, 2009 at 10:42 PM, Chingu <[email protected]>
> > > wrote:
>
> > >     Hi Helen I wanted thelabelsto attach with the markers without
> > > doing
> > >     mouseover the markers which means that it will always be showing
> > > the
> > >    labels.
> > >     So I can't use tooltip to do it :). Is it possible to do it or
> > > there's
> > >     no such thing lolx.
>
> > >     Thank u very much ^_^
>
> > > On Aug 27, 10:03 am, helen <[email protected]> wrote:
>
> > > > You could create a custom overlay class (extend OverlayBase) that
> > > > contains a text field with the lat/lng value and position it on the
> > > > map relative to yourmarkerpoint. See this example  by Pamela Fox
> > > > from the 
> > > > gallery:http://code.google.com/apis/maps/documentation/flash/demogallery.html...
>
> > > > Just add your custom overlay when you add themarker, and likewise
> > > > remove it if you remove themarker.
>
> > > > Helen
>
> > > > On Aug 26, 10:19 pm, Chingu <[email protected]> wrote:
>
> > > > > Hi everyone,
>
> > > > > I would like to createlabelsbeside every individual markers to show
> > > > > latitude and longitude values so that the users can see without
> > > > > clicking or doing rollover to the markers. Is it possible to do it?
>
> > > > > Many Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to