Entering content frame

Procedure documentation Zooming In Locate the document in its SAP Library structure

To zoom in on a geo object (for example, the start or destination address), proceed as follows:

1. Create a ZoomIn action.

2. Do the source mapping.

3. Implement the Action Handler onActionZoomIn

 

1. Create a ZoomIn Action

...

...

       1.      Create the action ZoomIn and assign the parameter geoObjectId (type: string).

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text       You need the geoObjectId to identify the geo object on which to zoom in.

...

...

       1.      Switch to the Layout tab page and bind the ZoomIn action to the GeoMap UI element.

UI Element Name

Event Name

Action

GeoMap

onAction

ZoomIn

2. SourceMapping

When you create a geo object, an ID is assigned to it (see Create Geo Objects). To this ID, you must now assign the geoObjectId parameter. To do this, call addSourceMapping(„id“, „geoObjectId“) in the method wdDoModifyView of the GeoServiceView:

       2.      Choose the Implementation tab page and add the following program code to the method wdDoModifyView.

wdDoModifyView

public static void wdDoModifyView(IPrivateGeoServiceView wdThis, IPrivateGeoServiceView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

  {

    //@@begin wdDoModifyView

   ...  

   geomap.mappingOfOnObjectAction().addSourceMapping("id",

                                                   "geoObjectId");

    //@@end

  }

3. Implement the Action Handler onActionZoomIn

After the assignment, you can implement the action handler onActionZoomIn.

...

       1.      Add the following source code to the method onActionZoomIn:

onActionZoomIn

public void onActionZoomIn(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String geoObjectId )

  {

    //@@begin onActionZoomIn(ServerEvent)

    List geoPos = new ArrayList();

    if(id.equals("0")){

      //Zoom 0.02 into Start

      geoPos.add(wdContext.currentStartAddressElement().getGeoPos());

      setMapBorder(geoPos, 0.02);

    }

    else{

      //Zoom 0.02 into Destination

      geoPos.add(wdContext.currentDestinationAddressElement().

                                                        getGeoPos());

      setMapBorder(geoPos, 0.02);

    }

    //@@end

  }

Result

You have created a Web Dynpro application that enables the user to plan a route between two different locations. In addition, you can zoom in on the start and destination addresses.

This graphic is explained in the accompanying textNext step:

Execute the Application Tutorial_GeoServices

  

  

 

Leaving content frame