[feature] Added zoom level as return param.

This commit is contained in:
d-kunin 2013-09-11 19:41:21 +03:00
parent cd80356929
commit fc852085df
2 changed files with 7 additions and 0 deletions

View file

@ -44,6 +44,7 @@ public class Const
public static final String EXTRA_MWM_RESPONSE_POINT_LAT = AUTHORITY + ".point_lat";
public static final String EXTRA_MWM_RESPONSE_POINT_LON = AUTHORITY + ".point_lon";
public static final String EXTRA_MWM_RESPONSE_POINT_ID = AUTHORITY + ".point_id";
public static final String EXTRA_MWM_RESPONSE_ZOOM = AUTHORITY + ".zoom_level";
public static final String ACTION_MWM_REQUEST = AUTHORITY + ".request";

View file

@ -22,12 +22,14 @@
******************************************************************************/
package com.mapswithme.maps.api;
import android.app.DownloadManager.Request;
import android.content.Context;
import android.content.Intent;
public class MWMResponse
{
private MWMPoint mPoint;
private double mZoomLevel;
/**
*
@ -35,6 +37,7 @@ public class MWMResponse
*/
public MWMPoint getPoint() { return mPoint; }
public boolean hasPoint() { return mPoint != null; }
public double getZoomLevel() { return mZoomLevel; }
@Override
public String toString()
@ -58,6 +61,9 @@ public class MWMResponse
final String name = intent.getStringExtra(Const.EXTRA_MWM_RESPONSE_POINT_NAME);
final String id = intent.getStringExtra(Const.EXTRA_MWM_RESPONSE_POINT_ID);
// parse additional info
response.mZoomLevel = intent.getDoubleExtra(Const.EXTRA_MWM_RESPONSE_ZOOM, 9);
if (lat != INVALID_LL && lon != INVALID_LL)
response.mPoint = new MWMPoint(lat, lon, name, id);
else