views:

31

answers:

2

i am trying to invoke blackberry map and label a location by address. i tried the sample code as following

public class invokeMaps
{
    public invokeMaps ()
    {
        Landmark[] landMarks = new Landmark[3];

        AddressInfo addressInfo = new AddressInfo();
        addressInfo.setField(AddressInfo.STREET, "455 Phillip St");
        addressInfo.setField(AddressInfo.CITY, "Waterloo");
        addressInfo.setField(AddressInfo.STATE, "Ontario");

        landMarks[0] = new Landmark("AAA", "Description 1", null, addressInfo);

        QualifiedCoordinates coordinates =
          new QualifiedCoordinates(45.4, -75.1, 0, 0, 0);

        landMarks[1] = new Landmark("BBB", "Description 2", coordinates, null);

        coordinates = new QualifiedCoordinates(45.3,-75.3,0,0,0);

        landMarks[2] = new Landmark("CCC", "Description 3", coordinates, null);

        MapsArguments ma = new MapsArguments(landMarks);
        Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);
  }
}

it only labels BBB and CCC, AAA is missing. i think that is because of AAA missing coordinates. my question is how can i retrive the coordinates for a location if i only have the address.

A: 

I bet you have to call a remote service which can translate addresses into collections of coordinates. The google places API looks promising.

Andreas_D
A: 

i found MapsArguments(Contact contact, int addressIndex) works without the need of coordinates.

Grey