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): polygon bounds #572

Merged
merged 7 commits into from
Sep 23, 2023
Merged

feat(android): polygon bounds #572

merged 7 commits into from
Sep 23, 2023

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 28, 2022

Add bounds property to Polygon. Will return the bounding box of the polygon.

Example:

const Map = require('ti.map');
const win = Ti.UI.createWindow();
const mapView = Map.createView({
	region: {
		latitude: 7.338208,
		longitude: 1.886329,
		latitudeDelta: 0.1,
		longitudeDelta: 0.1
	}
});

const polygon = Map.createPolygon({
	name: 'polygon_object',
	strokeWidth: 3,
	strokeColor: '#ffff00',
	fillColor: '#ff00ff',
	points: [{
			latitude: 53.677150,
			longitude: -7.728051
		},
		{
			latitude: 60.860020,
			longitude: 8.667197
		},
		{
			latitude: 50.396644,
			longitude: 9.769200
		},
		{
			latitude: 47.657334,
			longitude: -0.213136
		}
	]
});

win.add(mapView);
mapView.addPolygon(polygon);
setTimeout(function() {
	console.log(polygon.bounds);
	mapView.region = polygon.bounds;
}, 2000)
win.open();

will fit the polygon into the view.

ti.map-android-5.6.0.zip

@hansemannn
Copy link
Contributor

@m1ga Can you bump the version, change the "since" version to 12.3.0 (as ti.map currently uses the SDK version as the base -- I know, horrible, but that requires a whole change once)? Also, if possible, attach the new binary.

apidoc/Polygon.yml Outdated Show resolved Hide resolved
android/manifest Outdated Show resolved Hide resolved
@m1ga
Copy link
Contributor Author

m1ga commented Sep 23, 2023

sorry for the multiple updates, not at my main machine right now but I've made the changes in githubs editor and build a new version (see original post)

@hansemannn hansemannn merged commit 26cae56 into tidev:master Sep 23, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants