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
[Enhancement] Map with shapes from pin #1673
Comments
I'm willing to take a look at this issue. Would like some others input on what units to use to define the size of the circle. Do we want to just do a simple circle or allow more complex items like polygons or lines based on OpenGIS Well Know Binary/Text, etc? |
@bmacombe once the spec is "Ready for Implementation" I can make the assignment. I agree, a circle is too limited. Could this take any view instead? I'm looking at examples of other maps and we should be able to handle any manner of view that handles its own color, border, opacity, shape, and even animation. I think we need some example use cases to guide this. @dotMorten perhaps you have some insight? |
Using a view would be interesting, haven't thought of that angle. I come from a more GIS centric background, so point, lines, polygons described via spatial coordinates is my normal thinking but I could see just sticking a view on a pin as more useful for many apps. I'm happy to take a look once the spec is ready or glad to let someone else work on it also. |
I'd be happy to give some insights but I feel like some of the requirements here are missing. Is the circle supposed to show how far something is from the pin? Ie a 1mile radius? |
My suggestion is to add a bindable property to the
By default it's null, and the Map uses the current pin today. |
I find that terrible limited. I want pins to look different. It's also not clear how the PinTemplate would create a circle of a certain metric radius? |
@dotMorten That is similar to what I was thinking. I've used ArcEngine and ThinkGeo's mapsuite package for many years. I was thinking something like a layer, with geometry features defined in WKB with attributes and styles. What I wonder is many if the apps implemented in Forms are not doing the complicated GIS, but just need to quickly show locations on a map. Business locations, delivery radius, etc. It might be that both would best, I would like the fuller GIS features myself...enough that I've already implemented it on UWP, iOS and Android. But I did it early in my time with XF and I don't think the API or code quality is good enough to contribute it directly. If having the more complicated GIS features is something that will be of interest, I would be glad to propose an API based on my current work for further iteration. |
@bmacombe I guess you could also argue that this would be taking it too far for a simple map control, and might be hard to make work well cross-platform with the native map controls under them. The better approach might be to just support pins, as this is the most common scenario. |
@dotMorten Thanks for the Shameless Plug! I didn't know that existed! |
While not reaching the level of complexity and features available from ESRI, it actually is fairly easy to draw simple geometry (points, lines and polygons) on the native map controls. It could still be a useful feature for simple mapping needs. Just some examples below on the basic conversion from an NTS Polygon to a platform polygon for thought. I left Android out for now...because it's a mess! iOS
` uwp
|
Would anyone on this thread care to officially take on this enhancement and submit a pull request for it? Thanks! |
I could probably take a look at it, but I'm fairly busy at the moment. Not sure how quickly I would get it done. Is there any decision on if to just do the simple color and radius around a pin or something else? |
@bmacombe I think the better and more flexible option is to allow people to draw a polygon and/or polyline, and not focus so much on a radius circle. You could use the polygon approach to create that circle. |
@dotMorten To be clear are you thinking let them draw a polygon in screen coordinates and just draw that or in map coordinates? Edit: Or I should say in screen units or map units, didn't mean coordinates |
Map coordinates. Screen units makes no sense in this context. |
The ticket needs a spec clearly defined. Also, the title should be changed to reflect the need to display shapes on the map as described in the Rationale section. Here's my take: New members in the
The
The elements are implemented like the following:
Once the spec is approved I could try take a stab at it. |
@andreinitescu I'm not sure you need both Polyline and Polygon, shapes can be filled or not by |
@CZEMacLeod usually transparent background means it's still clickable. Someone might want some lines drawn but without having the interior clickable. |
@andreinitescu I think that argument can be made against the MapCircle - I can think of many instances where you want the circle itself to be clickable, but the interior not, such that you can click places or other locations, pins etc. inside. (e.g. Restaurants within X miles of your current location) |
I think it's better to have polyline and polygon separate, all platforms have it like this. |
* Add Polyline to Map * Android Polyline rendering * iOS polyline renderer * UWP polyline renderer * Unregister OnPolylineCollectionChanged in Dispose of UWP renderer * Add MapElement base class * Update Android MapRenderer with MapElement * Update UWP MapRenderer with MapElement * Update iOS MapRenderer with MapElement * Add polygons * Tweak functionality of gallery page * Rename some things in Android renderer * Made LoadPolyline and LoadPolygon virtual on UWP * Fix iOS/Mac MapRenderer compile errors fixes #1673 fixes #5773
* Add Polyline to Map * Android Polyline rendering * iOS polyline renderer * UWP polyline renderer * Unregister OnPolylineCollectionChanged in Dispose of UWP renderer * Add MapElement base class * Update Android MapRenderer with MapElement * Update UWP MapRenderer with MapElement * Update iOS MapRenderer with MapElement * Add polygons * Tweak functionality of gallery page * Rename some things in Android renderer * Made LoadPolyline and LoadPolygon virtual on UWP * Fix iOS/Mac MapRenderer compile errors fixes xamarin#1673 fixes xamarin#5773
* Add Polyline to Map * Android Polyline rendering * iOS polyline renderer * UWP polyline renderer * Unregister OnPolylineCollectionChanged in Dispose of UWP renderer * Add MapElement base class * Update Android MapRenderer with MapElement * Update UWP MapRenderer with MapElement * Update iOS MapRenderer with MapElement * Add polygons * Tweak functionality of gallery page * Rename some things in Android renderer * Made LoadPolyline and LoadPolygon virtual on UWP * Fix iOS/Mac MapRenderer compile errors fixes xamarin#1673 fixes xamarin#5773
Rationale
UX could reasonably want to overly shapes onto maps. For example, a semi-transparent circle centered on a pin.
Implementation
Could make it complicated and general or could just make it this:
Expected Result
A circular map overlay centered at the pin.
Implications for CSS
None.
Backward Compatibility
None.
Difficulty : Easy
The text was updated successfully, but these errors were encountered: