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): add heatmap support #472

Merged
merged 6 commits into from Aug 31, 2021

Conversation

hansemannn
Copy link
Contributor

@hansemannn hansemannn commented Aug 18, 2021

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28530

Summary:
The biggest change actually is to reuse the parseLocation method that was copied across all shape-related APIs. It's now part of the new TiMapUtils class an can be used across the project to parse LatLon pairs from a given object.

The heatmap related logic is inside the handleAddHeatMap method. Docs are included!

ti.map-android-5.4.0.zip

Test:

const Map = require('ti.map');
const window = Ti.UI.createWindow();
const mapView = Map.createView({
	region: { latitude: -37.840935, longitude: 144.946457 }, // Melbourne
});
mapView.addHeatMap([
	{ latitude: -37.1886, longitude: 145.708 },
	{ latitude: -37.8361, longitude: 144.845 },
	{ latitude: -38.4034, longitude: 144.192 },
	{ latitude: -38.7597, longitude: 143.67 },
	{ latitude: -36.9672, longitude: 141.083 },
//	[ 145.708, -37.1886 ],
//	[ 144.845, -37.8361 ],
//	[ 144.192, -38.4034 ],
//	[ 143.67, -38.7597 ],
//	[ 141.083, -36.9672 ],
]);
window.add(mapView);
//window.addEventListener('open', () => {
//	mapView.addHeatMap([
//		{ latitude: -37.1886, longitude: 145.708 },
//		{ latitude: -37.8361, longitude: 144.845 },
//		{ latitude: -38.4034, longitude: 144.192 },
//		{ latitude: -38.7597, longitude: 143.67 },
//		{ latitude: -36.9672, longitude: 141.083 },
//	]);
//});
window.open();

@build
Copy link

build commented Aug 18, 2021

Messages
📖

✅ All tests are passing
Nice one! All 292 tests are passing.
(There are 2 skipped tests not included in that total)

📖

💾 Here are the artifacts produced:

Generated by 🚫 dangerJS against d21f697

@jquick-axway jquick-axway self-requested a review August 31, 2021 05:11
@jquick-axway
Copy link
Contributor

@hansemannn , if you don't mind, I've updated this PR to:

  • Allow addHeatmap() to work before MapView creation.
  • Fixed lint warnings.
  • Temporarily reverted module version.

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR/FR: Pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants