0

I have a regular HTML form with a button that says "Get GPS". Once clicked, I want a popup to open with the blackberry maps invoked.

I want mapLocation to open in a new dialog box with a close button.

For example:

function mapLocation(lat, lon) {
  var args = new blackberry.invoke.MapsArguments(lat, lon);
  blackberry.invoke.invoke(blackberry.invoke.APP_MAP​S, args);
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169

1 Answers1

1

try this:

public class TestMapField extends MainScreen
{
    TestMapField()
    {
        super();

        ButtonField btn = new ButtonField("hello");
        btn.setChangeListener(fcl);
        add(btn);   

    }
    FieldChangeListener fcl = new FieldChangeListener()
    {
        public void fieldChanged(Field field, int context) {
            MapField mapField;
            int lat = (int) (43.4631 * 100000);
            int lon = (int) (-80.5327*100000);

            mapField = new MapField(MapField.FIELD_HCENTER);
            mapField.setPreferredSize(200, 150);
            mapField.moveTo(lat,lon);
            mapField.setZoom(0);
            HorizontalFieldManager hfm = new HorizontalFieldManager();
            hfm.add(mapField);
            PopupScreen obj = new PopupScreen(hfm);
            UiApplication.getUiApplication().pushScreen(obj);   
        }       
    };  
}
Swati
  • 2,870
  • 7
  • 45
  • 87