Skip to content

Commit

Permalink
Merge pull request #2504 from pingwang2011/timob-6855
Browse files Browse the repository at this point in the history
Timob 6855: Android: Function to get the current latitudeDelta and longitudeDelta from a MapView
  • Loading branch information
joshthecoder committed Jul 6, 2012
2 parents 0292ebd + e481334 commit a2386d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,16 @@ public void changeZoomLevel(int delta)
handler.obtainMessage(MSG_CHANGE_ZOOM, delta, 0).sendToTarget();
}

public double getLongitudeDelta()
{
return scaleFromGoogle(view.getLongitudeSpan());
}

public double getLatitudeDelta()
{
return scaleFromGoogle(view.getLatitudeSpan());
}

private Drawable makeMarker(int c)
{
OvalShape s = new OvalShape();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,18 @@ public void setLocation(KrollDict location)
}
}

@Kroll.getProperty @Kroll.method
public double getLongitudeDelta()
{
return mapView.getLongitudeDelta();
}

@Kroll.getProperty @Kroll.method
public double getLatitudeDelta()
{
return mapView.getLatitudeDelta();
}

public void onDestroy(Activity activity)
{
destroyMapActivity();
Expand Down
6 changes: 2 additions & 4 deletions apidoc/Titanium/Map/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,13 @@ properties:
summary: The amount of north-to-south distance displayed on the map, measured in decimal degrees.
type: Number
permission: read-only
platforms: [iphone, ipad, mobileweb]
since: "1.9.0"
since: {android: "2.2.0", iphone: "1.9.0", ipad: "1.9.0", mobileweb: "1.9.0"}

- name: longitudeDelta
summary: The amount of east-to-west distance displayed on the map, measured in decimal degrees.
type: Number
permission: read-only
platforms: [iphone, ipad, mobileweb]
since: "1.9.0"
since: {android: "2.2.0", iphone: "1.9.0", ipad: "1.9.0", mobileweb: "1.9.0"}

---
name: MapRegionType
Expand Down

0 comments on commit a2386d4

Please sign in to comment.