Thanks Both,

I have decided to try and implement the viewpoint method (the other
looks far too complicated for an amateur like me!!). I put the code
below into my onMapReady function but when I search random places they
all were available.

var myLatLngBounds:LatLngBounds = new LatLngBounds(
    new LatLng(0.000001, 0.000001),
    new LatLng(0.000001, 0.000001));

        var options:ClientGeocoderOptions = new ClientGeocoderOptions({
viewport: myLatLngBounds
});

Do I have to do anything else to stop my search?

This is what I have used to implement my search:

function createPoint(event:Event):void {

        var my_point:ClientGeocoder = new ClientGeocoder();


        // create Custom marker object
        var mc_icon:marker_icon = new marker_icon();
        var markerPin:marker_pin = new marker_pin();

        my_point.addEventListener(;
        GeocodingEvent.GEOCODING_SUCCESS,;
        function(event:GeocodingEvent):void {;
        var placemarks:Array = event.response.placemarks;
        if (placemarks.length > 0) {;
        map.setCenter(placemarks[0].point, 18);
        var marker:Marker = new Marker(placemarks[0].point,;
        new MarkerOptions({ ;
        hasShadow: true,;
        icon: mc_icon.addChild(markerPin),;
        iconOffset: new Point(0, -35);
        })  ;
        );

        marker.addEventListener(MapMouseEvent.CLICK, function
(event:MapMouseEvent):void {;
        marker.openInfoWindow(new InfoWindowOptions({;
        content: placemarks[0].address;
        }));
        });
        map.addOverlay(marker);
};
});
my_point.addEventListener(;
GeocodingEvent.GEOCODING_FAILURE,;
function(event:GeocodingEvent):void {;
trace(event);
trace(event.status);
});
my_point.geocode(address.text);
}

Forgive my ignorance, I am a novice to AS3

Phil

On Jun 21, 2:13 pm, Ian Appleby <[email protected]> wrote:
> http://code.google.com/apis/maps/documentation/flash/reference.html#C...
>
> use the viewport option
>
> On Jun 21, 1:57 pm, J_Mo <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I have created a Google Map API in Flash CS3 with some overlays & a
> > search facility. My problem is that I would like to put some
> > parameters on the search so it only searches a specific area....is
> > this possible??
>
> > I am not the best in AS3 so the simpler the explanation the better!
>
> > Thanks
> > Phil

-- 
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