CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

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

Open shai-almog opened this issue 4 years ago • 16 comments

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 avatar Jul 21 '20 02:07 shai-almog

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...

Double-A-92 avatar Oct 06 '21 21:10 Double-A-92

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

shannah avatar Oct 06 '21 21:10 shannah

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 https://github.com/codenameone/CodenameOne/pull/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.

Double-A-92 avatar Oct 07 '21 11:10 Double-A-92

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

shannah avatar Oct 07 '21 12:10 shannah

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 avatar Oct 07 '21 12:10 Double-A-92

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.

Double-A-92 avatar Oct 08 '21 22:10 Double-A-92

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

shai-almog avatar Oct 09 '21 02:10 shai-almog

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

Ranzeb avatar Aug 23 '22 20:08 Ranzeb

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?

Omkar2509 avatar Apr 06 '23 20:04 Omkar2509

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.

shai-almog avatar Apr 07 '23 03:04 shai-almog

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.

colinldbd avatar Oct 20 '23 06:10 colinldbd

I'd like to take up this issue

anniepauline avatar Feb 17 '24 05:02 anniepauline

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

shai-almog avatar Feb 18 '24 02:02 shai-almog