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

WIP: [RFC]: Bring Flask-GoogleMaps up to date with latest dependencies #159

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

argysamo
Copy link
Collaborator

Fixes #158

@argysamo
Copy link
Collaborator Author

hey @getcake ,
I started working a feature branch to update Flask Google-Maps to use the latest Google Maps API and make it work with Flask 3.X.X.
Regarding the former, there's much more flexibility with creating markers. The colour of those can be easily customized via a PinElement.
One could use an html img (or even a div) as a marker. I have (kind of) implemented the support for an img element.

Making all these changes, it's kind of difficult to maintain backwards compatibility.
This mainly regards, the way a user can define markers.
More specifically, I wasn't able to think of way to maintain the icon notion with the new API, and thus I removed it.

Along with the aforementioned updates, I am refactoring a bit the code introducing unit tests.

Do you have any concerns? Do you think that these changes would be of value?

Cheers,
Argyris

@argysamo
Copy link
Collaborator Author

maybe @rochacbruno ?

@argysamo argysamo marked this pull request as draft April 16, 2024 17:04
@argysamo argysamo force-pushed the develop branch 6 times, most recently from 6e602f4 to 978b301 Compare April 17, 2024 22:45
@argysamo
Copy link
Collaborator Author

maybe @cuducos ?

@argysamo
Copy link
Collaborator Author

@marcuxyz ?

@rochacbruno
Copy link
Member

LGTM @argysamo regarding the icon, as long as there is an alternative to add icons with the new markers API I am ok on doing a major release removing the icons API.

@rochacbruno
Copy link
Member

The example site build is failing because image is outdated on Netlify, it is running on @Riverfount account, I think what is needed is to check netlify panel and opt-in for an image update I guess.

@Riverfount
Copy link
Member

The example site build is failing because image is outdated on Netlify, it is running on @Riverfount account, I think what is needed is to check netlify panel and opt-in for an image update I guess.

I can move it to another account, but which account?

@Riverfount
Copy link
Member

The example site build is failing because image is outdated on Netlify, it is running on @Riverfount account, I think what is needed is to check netlify panel and opt-in for an image update I guess.

I can move it to another account, but which account?

Sorry guys I can't move the site to another account on Netlify, but I can continue to maintain it in my account!

@argysamo
Copy link
Collaborator Author

thanks so much for the feedback and the actions. Great to hear that you are interested in the new Markers API. I will continue with code change and testing, update the documentation and ping you here once the PR is ready to be reviewed!

@marcuxyz
Copy link
Member

it's very nice @argysamo . I believe that things as:

  • packages updates
  • ci configurations

Can be separated in another pr.

👏🏾 👏🏾 👏🏾 👏🏾 👏🏾

@argysamo
Copy link
Collaborator Author

Hey @marcuxyz ,
Makes total sense. I will cherry pick right now the ci changes and create a new PR.
Thanks!

@rochacbruno
Copy link
Member

needs a rebase

argysamo added 10 commits May 6, 2024 19:11
- Update dependencies (Flask, mypy, python >3.8)
- Load javascript in an async manner
- Replace obsolete `Marker` with `AdvancedMarkerElement`
- Introduce PinElement
- Minor javascript refactoring
- Remove icon functionality
- Replace javascript for loops with jinja. I did this in order to create "dynamic" js variables to have an "img" icon.
- This is not clever though. I will revert the js loop and then use jinja2 to create the img element when needed
- MarkerContent is an abstract method. It can be either a Pin or Image
- Marker object comprises of MarkerContent
- Add unit tests
- I am bothered by the use of `eval` method for the content
- MarkerContentFactory returns the appropriate MarkerContent implementation (i.e. either Pin or Image)
- Add unit tests
- Reformat files with `black`
- Update dependencies. E.g. jsmin -> 3.0.1 as this version removes the use_2to3, which creates issues with latest setuptools
- Move and refactor test_map.py
- Bump Python dependency to 3.9
- Use latest flake8 revision
@Riverfount
Copy link
Member

Hi, guys if you need some help and just me I can do it, mark me on the comment because I see them more quickly.

- Documentation: Describe the new markers setup
- Remove `label` field from marker.py
- Add support for `scale` for a pin.py
@argysamo
Copy link
Collaborator Author

argysamo commented May 30, 2024

Hello all,
I didn't make any progress for the last couple of weeks.
I started working again on the documentation now, and will verify that the new changes don't break existing functionality.
I will update you when changes are ready for review.

Cheers,
Argyris

- clusters, moving map, latlon don't work
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.

[RFC]: Bring Flask-GoogleMaps up to date with latest dependencies
4 participants