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): expose ImageOverlay image setter #702

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jan 31, 2025

Exposes the image setter of an ImageOverlay and you can use external URLs now:

var Map = require('ti.map');
var win = Titanium.UI.createWindow();

var mapview = Map.createView({
	mapType: Map.NORMAL_TYPE,
	region: {
		latitude: 34.4311,
		longitude: -118.6012,
		latitudeDelta: 0.01,
		longitudeDelta: 0.01
	},
	animate: true,
	regionFit: true,
	userLocation: true,
});

let imgOverlay = Map.createImageOverlay({
	image: "https://picsum.photos/200/200",
	boundsCoordinate: {
		topLeft: {
			latitude: 34.4311,
			longitude: -118.6012
		},
		bottomRight: {
			latitude: 34.4194,
			longitude: -118.5912
		},
	},
})
mapview.addImageOverlays([imgOverlay]);
setTimeout(function() {
	imgOverlay.image = "/image2.png";
}, 2000);
win.add(mapview);
win.open();
  • add image: image2.png
  • extern URL will be shown
  • image2 will be shown after 2 seconds

ti.map-android-5.6.2.zip

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.

1 participant