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(shapes): add support for drawing polyline, polygon and circle #157

Open
5 tasks
tafelnl opened this issue Mar 31, 2022 · 19 comments
Open
5 tasks

feat(shapes): add support for drawing polyline, polygon and circle #157

tafelnl opened this issue Mar 31, 2022 · 19 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tafelnl
Copy link
Member

tafelnl commented Mar 31, 2022

It should be possible to draw basic shapes on the map. There's actually already an open PR that adds this: #149

It adds the methods addPolygon, addPolyline and addCircle with some options. E.g. to fill them with a solid color and to adjust the color of the stroke (i.e. the border of the shape).

However, to be on par with the API the Google SDK offers, some additional functionality is needed as well.


We will first focus on completing the functionality of the polygon shape only. Later on, we will add similar functionality to the polyline and circle shapes as well. This way we keep the scope smaller. The requirements are as follows:


The API in the PR regarding the polygon (as said above) only has the addPolygon method right now. But it should be on par with the API that the Android SDK of Google itself offers (can be found here).

More specifically, this will thus entail the following changes:

  • 1. Keep a list of drawn polygons. This means a polygon that is added, should be saved in some sort together with an guid. For reference: the addMarker method has similar functionality.
  • 2. The PolygonOptions of the PR already supports specifying the points, tag, strokeColor, fillColor, strokeWidth, zIndex and the visibility. Support should also be added for clickable, geodesic, holes, strokePattern, strokeJointType.
  • 3. Add a getPolygon(id: string) method, that returns all properties of the specified polygon. For reference: the getḾap method has similar functionality.
  • 4. Add a updatePolygon(id: string, preferences: object) method, which accepts the same preference parameters as the addMarker method, so the polygon can be updated.
  • 5. Add a removePolygon(id: string) method, so a polygon can be removed (remember to update the list mentioned in 1 as well).

Bonus 1: it should be possible to - instead of a solid color fill - apply a pattern of images to a polygon. For more information, check this Stack Overflow question

Bonus 2: it should be possible to place the shapes on top of the markers. Normally they are drawn behind the markers.

@tafelnl tafelnl added the enhancement New feature or request label Mar 31, 2022
@tafelnl
Copy link
Member Author

tafelnl commented Mar 31, 2022

@galilov will soon start with the implementation on Android. If someone would like to contribute and help with the iOS part, please feel free to chime in :)

@nodiced922

This comment was marked as duplicate.

@woodely

This comment was marked as duplicate.

@IbrahimElkhatib

This comment was marked as duplicate.

@EdByrnee

This comment was marked as duplicate.

@tafelnl
Copy link
Member Author

tafelnl commented Jan 20, 2023

Partly shipped in 2.0.0-beta.6: adding polygons is now supported.

@WynOwen72
Copy link

Hi,

Is there a timeline for adding Polylines to this Plugin? It works wonderfully in my app BTW.

@asma-omar
Copy link

asma-omar commented Apr 27, 2023

=

Hi,

Is there a timeline for adding Polylines to this Plugin? It works wonderfully in my app BTW.

did you mean polyline works on your app ?how can i add polyline to map?

@WynOwen72
Copy link

WynOwen72 commented May 1, 2023

Hi Good Morning,

What I meant is that the basic map, zoom, maptype etc all work. My question is your second question:

how can i add polyline to map?

I see it's not officially part of the plugin but I've seen bits referring to polylines in the code.

@Timileyin105
Copy link

@WynOwen72 @asma-omar i was able to use polyline feature on the map
i had to edit the google map source code

result

Screenshot_20230509150816

@Timileyin105
Copy link

Timileyin105 commented May 9, 2023

if the team hasn't gotten this feature already developed, i can take my time to contribute to this

@WynOwen72
Copy link

if the team hasn't gotten this feature already developed, i can take my time to contribute to this

My skills are weak in Java and Swift but i'd love to take a peek.

@tafelnl
Copy link
Member Author

tafelnl commented May 10, 2023

PRs are welcome! Please try to adhere to the coding guidelines and principles in the codebase. That'll make it easier for me to review it.

@Timileyin105
Copy link

alright

@jldlxs

This comment was marked as duplicate.

@Timileyin105
Copy link

@jidlxs and @WynOwen72 i plan to work on this and push it tomorrow

@WynOwen72
Copy link

@jidlxs and @WynOwen72 i plan to work on this and push it tomorrow

Thank you :-)

@jldlxs
Copy link

jldlxs commented May 12, 2023

@jidlxs and @WynOwen72 i plan to work on this and push it tomorrow

This is amazing.
Thank you so much.

@Timileyin105
Copy link

hello @jldlxs @WynOwen72 @tafelnl
i just opened a pull for the polyline
currently i use window and can't use xcode to work on the feature for ios

@tafelnl please review this and let me know if ok or there is still some works
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants