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

Create an open street map location finder instead of the old google maps one #3173

Closed
shai-almog opened this issue Jul 21, 2020 · 19 comments
Closed
Labels
first-timers-only For first-time contributors good first issue Good for getting started Hacktoberfest Suitable for new contributor. Part of Hacktoberfest help wanted up-for-grabs For new contributors your-first-pr Make your first pull request
Milestone

Comments

@shai-almog
Copy link
Collaborator

The location simulator has commented out code that supports google maps here:
https://github.com/codenameone/CodenameOne/blob/master/Ports/JavaSE/src/com/codename1/impl/javase/LocationSimulation.java

If you look at the history of the file this was working well and was even contributed by 3rd party https://github.com/codenameone/CodenameOne/commits?author=PiotrZub

The reason the code was commented out is that Google Maps now requires a credit card to work and we can't distribute our map key as part of an open source project. The solution of proxy won't work either since this can be sniffed. Instead this should use another map API like Open Street Map where a credit card isn't required.

This should just require updating the HTML to that new map API and updating the binding. Ideally we'll also update this to use CEF instead of FX but I'll leave that as a separate task.

@shai-almog shai-almog added the good first issue Good for getting started label Jul 21, 2020
@shai-almog shai-almog added this to the Version 8.0 milestone Jul 21, 2020
@shannah shannah added the Hacktoberfest Suitable for new contributor. Part of Hacktoberfest label Sep 2, 2021
@yo-zubair yo-zubair added first-timers-only For first-time contributors help wanted up-for-grabs For new contributors your-first-pr Make your first pull request labels Sep 6, 2021
@Double-A-92
Copy link
Contributor

I wanted to do this and replace the old Google Maps code with LeafletJS, but I really can't figure out how to even build and run the project...

Is there any detailed setup guide? To I need a special IDE to run it? I tried IntelliJ but maven is refusing to build it because something with Java 5.

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ codenameone-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 629 source files to C:\Users\amato\Documents\repos\CodenameOne\maven\core\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[INFO] 2 errors 
[INFO] -------------------------------------------------------------

Any Idea what it could be?

Also I'm not really sure where I have to put the codenameone-skins and cn1-binaries directories that I was told to download...

@shannah
Copy link
Collaborator

shannah commented Oct 6, 2021

There are maven build instructions in the readme. Basically
cd maven
mvn install

Use jdk8 or jdk11

Then create a test project using start.codenameone.com

And change the cn1.version and cn1.plugin.version properties to 8.0-SNAPSHOT

@Double-A-92
Copy link
Contributor

There are maven build instructions in the readme. Basically cd maven mvn install

Use jdk8 or jdk11

Then create a test project using start.codenameone.com

And change the cn1.version and cn1.plugin.version properties to 8.0-SNAPSHOT

Hi, I finally got it working, but I had to do little changes all over the maven configurations. I committed my changes as #3509 , maybe they might be useful to someone.

Could you maybe give it a look to check that I didn't completely ruin something? Thank you.

@shannah
Copy link
Collaborator

shannah commented Oct 7, 2021

Thanks for the PR. I've added some comments there and requested a couple of changes.

@shannah shannah closed this as completed Oct 7, 2021
@Double-A-92
Copy link
Contributor

My PR didn't actually solve this issue, just the issue of not being able to use maven.
I assume this issue could have stayed open?

@Double-A-92
Copy link
Contributor

Unfortunately the old commented out code doesn't work anymore because of missing javafx dependencies. I read here that it has been replaced by JCFE.

Are there any examples of the new way to create a "web view" panel somewhere in the code? The old code basically created a website which loaded Google Maps, and then just displayed that inside JFXPanel.

@shai-almog
Copy link
Collaborator Author

See the code here: https://github.com/codenameone/CodenameOne/tree/master/Ports/JavaSE/src/com/codename1/impl/javase/cef It's mostly @shannah who worked on it so I can't point at a specific block of code

@Ranzeb
Copy link

Ranzeb commented Aug 23, 2022

I am new to open-source contributions and I want to contribute. Can I contribute?

@Omkar2509
Copy link

Hello, I'm new to open source contribution. I want to get started with solving some sort of issues. Can you suggest me any other good first issue or should I work on this same issue only?

@shai-almog
Copy link
Collaborator Author

Sure. You can pick any issue you want. If it's marked as Good first issue it usually means we reviewed the issue and its:

  • Relatively simple
  • Isolated - so you don't need to know "everything" in order to work on it

You can also look through the issue database for things that spark your interest and ask about them.

@colinldbd
Copy link

Hi, I'm a new contributor and learning how to contribute to Open Source Project, can you assign this issue to me so that I can give it a try to solve this issue?

I'll follow the contribution guide carefully.

@anniepauline
Copy link

I'd like to take up this issue

@shai-almog
Copy link
Collaborator Author

@anniepauline yes. Sorry @colinldbd I missed your comment there, I'm assuming you moved on to something else.

@Jenish-1235
Copy link

I am beginner to open source contribution and would like to pick up this issue. Could you let me know , can I pick up this issue ?

@shai-almog
Copy link
Collaborator Author

@Jenish-1235 yes

@Jenish-1235
Copy link

I tried installing codenameone using maven and ant both of them. I facing an issue with the installation process. Probably due to my java version. I tried uninstalling my current java version and installing java 8 too. Still it is showing the same error. Attaching screenshot of the error. Could you help me to resolve it.
image

@SamC1832js
Copy link
Contributor

I commited my changes in #3863, I replaced Google Maps with OpenStreetMap for the LocationSimulation, and tested in bare bone java app using Codename One initializr.

The latitude and longitude in the form are dynamically updated when the map position changes.

I found a known issue: When LocationSimulation is closed and reopened, the map does not display. The current workaround is to keep LocationSimulation open throughout the development process.

SamC1832js added a commit to SamC1832js/CodenameOne that referenced this issue Jan 22, 2025
…oogle map page and change lambdas to anonymous classes to follow Java 7 syntax.

Tested functionality using a bare-bones Java app via Codename One Initializr.

pull request: codenameone#3863
issue: codenameone#3173

Known Issue:
- When LocationSimulation is closed and reopened, the map does not display.
-Workaround: Keep LocationSimulation open during the development process.
shai-almog pushed a commit that referenced this issue Jan 22, 2025
…#3863)

* Refactor LocationSimulation: Replace Google Maps with Open Street Map

Refactor LocationSimulation: Replace Google Maps with OpenStreetMap

- Replaced the Google Maps implementation with OpenStreetMap in the LocationSimulation feature.
- Enhanced the functionality to dynamically update form fields (latitude and longitude) when the map position changes.

- Known Issue: When LocationSimulation is closed and reopened, the map does not display. The current workaround is to keep LocationSimulation open throughout the development process.

* Refactor LocationSimulation: Remove commented out code for previous Google map page and change lambdas to anonymous classes to follow Java 7 syntax.

Tested functionality using a bare-bones Java app via Codename One Initializr.

pull request: #3863
issue: #3173

Known Issue:
- When LocationSimulation is closed and reopened, the map does not display.
-Workaround: Keep LocationSimulation open during the development process.
@shai-almog
Copy link
Collaborator Author

Fixed in #3863 by @SamC1832js

@all-contributors please add @SamC1832js for code

Copy link
Contributor

@shai-almog

I've put up a pull request to add @SamC1832js! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-timers-only For first-time contributors good first issue Good for getting started Hacktoberfest Suitable for new contributor. Part of Hacktoberfest help wanted up-for-grabs For new contributors your-first-pr Make your first pull request
Projects
None yet
Development

No branches or pull requests

10 participants