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

MapView as a layout for native Android views? #680

Closed
schildbach opened this issue Sep 16, 2015 · 4 comments
Closed

MapView as a layout for native Android views? #680

schildbach opened this issue Sep 16, 2015 · 4 comments
Milestone

Comments

@schildbach
Copy link
Contributor

The old Google Maps v1 library had this wonderful feature where MapView would act as a geo-coordinate-aware layout. You would add views to the layout and they would follow all map panning and zooming.

mapView.addView(view, new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
    point, 
MapView.LayoutParams.BOTTOM_CENTER));

Here is how the view could look. Other than markers etc. it contains native Android buttons.

device-2015-09-16-234321

Is something like this planned for mapsforge?

@devemux86
Copy link
Collaborator

Agreed that it would be a useful feature to have in Mapsforge.
I have tried it in the past, not without issues at pan / zoom and neglected it.

Experiments could start as always in Samples app.

@schildbach
Copy link
Contributor Author

This is the next feature I will work on shortly, if no one else beats me at it.

@devemux86
Copy link
Collaborator

Thanks, merged with some improvements.

  • View overlays are not handled properly during zoom scale animation
  • Osmdroid similar implementation has also additional x/y offsets for the alignment location (might be unnecessary)

@devemux86 devemux86 added this to the 0.5.3 milestone Sep 22, 2015
@schildbach
Copy link
Contributor Author

Thanks for merging.
Zoom scale animations: this will be fixed once we do proper zoom animations. Currently zoom animations are very local to MapViewPosition. Also see my comment about that on #688.
Offsets: if there is a usecase, we can easily add that. I never had one, as I was always anchoring to one of the 9 standard alignment points.

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

No branches or pull requests

2 participants