Skip to content

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

Merge #678 first for workflow and map update

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.

2 participants