javax.microedition.location.services
Interface MapServiceListener

All Superinterfaces:
ServiceListener

public interface MapServiceListener
extends ServiceListener

This interface provides a callback mechanism for the map service providers to send information about the service request to applications. Applications implement this interface and register it in the service request in MapServiceProvider to obtain information from the service provider. The relationship with the MapServiceProvider methods is described in the MapServiceProvider class.

Since:
2.0

Field Summary
 
Fields inherited from interface javax.microedition.location.services.ServiceListener
SERVICE_DATA_LOADING, SERVICE_DATA_LOADING_DONE
 
Method Summary
 void mapContentUpdated(MapServiceProvider provider, Map map)
          Called by the API implementation when the base map data has changed, for example, due to retrieving new data from network.
 void selectionUpdated(MapServiceProvider provider, GeographicArea[] areas, Landmark[] landmarks, Coordinates[] coordinates, Route[] routes)
          Called by the map service provider when an application has requested a selection or multiple selections from the map from the user.
 
Methods inherited from interface javax.microedition.location.services.ServiceListener
configurationCompleted, requestAborted, requestCanceled, requestCompleted, requestError, serviceDataStatus
 

Method Detail

selectionUpdated

void selectionUpdated(MapServiceProvider provider,
                      GeographicArea[] areas,
                      Landmark[] landmarks,
                      Coordinates[] coordinates,
                      Route[] routes)

Called by the map service provider when an application has requested a selection or multiple selections from the map from the user. The notification contains information about all currently selected items.

The objects returned in this notification must contain the same information as the items passed in the MapServiceProvider.displayMap method. This guarantees that the returned items may be further used in the other methods in this API. This use can be, for example, managing LandmarkStore or navigating through a route.

Parameters:
provider - the MapServiceProvider whose selection was updated
areas - an array of selected areas, an empty array if no area has been selected
landmarks - an array of currently selected Landmark objects, an empty array if no landmark has been currently selected
coordinates - an array Coordinates objects of currently selected points, an empty array if no point has been currently selected
routes - an array of currently selected Route objects, an empty array if no routes have been currently selected

mapContentUpdated

void mapContentUpdated(MapServiceProvider provider,
                       Map map)

Called by the API implementation when the base map data has changed, for example, due to retrieving new data from network. The updated Map object is given as parameter. This is the same instance that was already retrieved with MapServiceProvider.getMap method. An application should refresh its screen after this callback method is called, and call the Map.renderMap method again to get more complete map image rendered.

This method is called just to notify that the map content has changed; thus the application does not need to do a screen coordinate refresh to any of the items it is rendering itself.

Parameters:
provider - the MapServiceProvider whose map content was updated
map - the Map that has been changed


Copyright © 2003-2008 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.