[and] Pick point API feature.

This commit is contained in:
d-kunin 2013-09-04 19:31:42 +03:00
parent 04d7ff56af
commit ba328f7cb9
4 changed files with 24 additions and 0 deletions

View file

@ -2,4 +2,9 @@
package="com.mapwithme.maps.api"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="18" />
</manifest>

View file

@ -34,6 +34,7 @@ public class Const
public static final String EXTRA_HAS_PENDING_INTENT = AUTHORITY + ".has_pen_intent";
public static final String EXTRA_CALLER_PENDING_INTENT = AUTHORITY + ".pending_intent";
public static final String EXTRA_RETURN_ON_BALLOON_CLICK = AUTHORITY + ".return_on_balloon_click";
public static final String EXTRA_PICK_POINT = AUTHORITY + ".pick_point";
/* Response extras */

View file

@ -135,6 +135,15 @@ public final class MapsWithMeApi
sendRequest(caller, request);
}
public static void pickPoint(Activity caller, String title, PendingIntent pi)
{
final MwmRequest request = new MwmRequest()
.setTitle(title)
.setPickPointMode(true)
.setPendingIntent(pi);
sendRequest(caller, request);
}
/**
* Detects if any version (Lite, Pro) of MapsWithMe, which supports API calls
* are installed on the device.

View file

@ -21,6 +21,7 @@ public class MwmRequest
private String mTitle;
private double mZoomLevel = 1;
private boolean mReturnOnBalloonClick;
private boolean mPickPoint = false;
// **
public MwmRequest setTitle(String title)
@ -29,6 +30,12 @@ public class MwmRequest
return this;
}
MwmRequest setPickPointMode(boolean pickPoint)
{
mPickPoint = pickPoint;
return this;
}
public MwmRequest addPoint(MWMPoint point)
{
mPoints.add(point);
@ -75,6 +82,8 @@ public class MwmRequest
mwmIntent.putExtra(Const.EXTRA_TITLE, mTitle);
// more
mwmIntent.putExtra(Const.EXTRA_RETURN_ON_BALLOON_CLICK, mReturnOnBalloonClick);
// pick point
mwmIntent.putExtra(Const.EXTRA_PICK_POINT, mPickPoint);
final boolean hasIntent = mPendingIntent != null;
mwmIntent.putExtra(Const.EXTRA_HAS_PENDING_INTENT, hasIntent);