Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): mbtiles overlay #590

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
max/minZoomLevel
m1ga committed Oct 16, 2022
commit d188a15782d8ec68370e65f151432f56bfe6d506
15 changes: 14 additions & 1 deletion android/src/ti/map/TiUIMapView.java
Original file line number Diff line number Diff line change
@@ -88,6 +88,8 @@ public class TiUIMapView extends TiUIFragment
private DefaultClusterRenderer clusterRender;
private MarkerManager mMarkerManager;
private MarkerManager.Collection collection;
private float minZoom = -1;
private float maxZoom = -1;

public TiUIMapView(final TiViewProxy proxy, Activity activity)
{
@@ -239,7 +241,12 @@ public void onMapReady(GoogleMap gMap)
markerCollection.setInfoWindowAdapter(this);
markerCollection.setOnInfoWindowClickListener(this);
markerCollection.setOnMarkerDragListener(this);

if (minZoom != -1) {
map.setMinZoomPreference(minZoom);
}
if (maxZoom != -1) {
map.setMaxZoomPreference(maxZoom);
}
((ViewProxy) proxy).clearPreloadObjects();
}

@@ -322,6 +329,12 @@ public void processMapProperties(KrollDict d)
if (clusterRender != null)
clusterRender.setMinClusterSize(d.getInt(MapModule.PROPERTY_MIN_CLUSTER_SIZE));
}
if (d.containsKey("maxZoomLevel")) {
maxZoom = Float.parseFloat(d.getString("maxZoomLevel"));
}
if (d.containsKey("minZoomLevel")) {
minZoom = Float.parseFloat(d.getString("minZoomLevel"));
}
}

@Override
6 changes: 0 additions & 6 deletions android/src/ti/map/ViewProxy.java
Original file line number Diff line number Diff line change
@@ -791,11 +791,8 @@ public float getMinZoom()
}
}

// clang-format off
@Kroll.method
@Kroll.getProperty
public float getMaxZoomLevel()
// clang-format on
{
if (TiApplication.isUIThread()) {
return getMaxZoom();
@@ -804,11 +801,8 @@ public float getMaxZoomLevel()
}
}

// clang-format off
@Kroll.method
@Kroll.getProperty
public float getMinZoomLevel()
// clang-format on
{
if (TiApplication.isUIThread()) {
return getMinZoom();
11 changes: 6 additions & 5 deletions apidoc/View.yml
Original file line number Diff line number Diff line change
@@ -709,9 +709,9 @@ properties:
platforms: [android]

- name: maxZoomLevel
summary: Returns the maximum zoom level available at the current camera position.
summary: Maximum zoom level available at the current camera position.
description: |
Returns the maximum zoom level for the current camera position.
Set and returns the maximum zoom level for the current camera position.
This takes into account what map type is currently being used.
For example, satellite or terrain may have a lower max zoom level than the base map tiles.

@@ -720,18 +720,19 @@ properties:
type: Number
platforms: [android]
permission: read-only
availability: creation

- name: minZoomLevel
summary: Returns the minimum zoom level available at the current camera position.
summary: Minimum zoom level available at the current camera position.
description: |
Returns the minimum zoom level. This is the same for every location (unlike the maximum zoom level)
Set and returns the minimum zoom level. This is the same for every location (unlike the maximum zoom level)
but may vary between devices and map sizes.

This will only give the correct value after the 'complete' event is fired.
since: "3.2.3"
type: Number
platforms: [android]
permission: read-only
availability: creation

- name: minClusterSize
summary: Sets the minium size of a cluster.