HI thanks for giving me a clue to solve my query.But stilll i found no way
to resolve it.I used the following code.


    function get_map(address)
        {
        geocoder = new GClientGeocoder();
        geocoder.getLocations(address, addToMap);
        }

    function createMarker(lng, lat, letter, html_text)
        {
        var point = new GPoint(lng, lat);
        var icon = new GIcon(G_DEFAULT_ICON);
        icon.image = "markers/3.png";
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function () {
marker.openInfoWindowHtml(html_text); });
        return marker;
        }


    function addToMap(response)
        {
        place = response.Placemark[0];
        longitude=place.Point.coordinates[0];
        latitude=place.Point.coordinates[1];
        map.centerAndZoom(new GPoint(longitude,latitude), 6);
        add_div='<div style="width:200px;height:60px;">';
        add_div+=place.address;
        add_div+='</div>';
        var testMarker = createMarker(longitude, latitude, '', add_div);
        map.addOverlay(testMarker);
        }
Now how can i pass any other value of database to create marker function.I
need to give different colors to markers according to that value in
database.Please reply me with suitable example if possible......

On Fri, Feb 20, 2009 at 6:56 PM, Esa <[email protected]> wrote:

>
>
>
> On Feb 20, 1:21 pm, "[email protected]" <[email protected]> wrote:
> > I am able to geocode multiple addresses from the database by using
> > getlocation() function.
> > I want to change the markers colour according to other field value in
> > database.
> > But getlocation(); accepts only two parameters (address,point).Please
> > tel me how i can to tht.?
>
> Geocoding has nothing to do with marker color. You have to set the
> marker icon by the 'other field value in database'.
>
> There are numerous examples out there. This is one of them
> http://mapsapi.googlepages.com/categories.htm
>
> If you have a database, you should geocode your addresses in batch and
> store the coordinates in the db. Page loading is much much faster by
> using coordinates instead of addresses. Unnecessary http requests are
> avoided.
> >
>

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