You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Open Codename One Preferences (i.e. Control Center)
13
+
2. Go to "Advanced Settings" > "Extensions" in the menu.
14
+
3. Find the "Codename One Google Native Maps" option.
15
+
4. Press "Download"
16
+
17
+
Back in your IDE (e.g. IntelliJ, NetBeans, Etc..) select the "Refresh Cn1libs" option in the Codename One menu.
18
+
19
+
### Maven Dependency
20
+
21
+
If you are using Maven as your build tool, then you can simply paste the following snippet into your common/pom.xml file:
22
+
23
+
~~~~
24
+
<dependency>
25
+
<groupId>com.codenameone</groupId>
26
+
<artifactId>googlemaps-lib</artifactId>
27
+
<version>1.0.1</version>
28
+
<type>pom</type>
29
+
</dependency>
30
+
~~~~
31
+
32
+
NOTE: You should replace the `version` with the [latest on Maven central](https://search.maven.org/artifact/com.codenameone/googlemaps-lib).
33
+
34
+
## Limitations
9
35
1. The native maps are only supported on Android devices that have the Google Play store (e.g. not on Amazon Kindle)
10
36
and on iOS devices. All other devices will show the MapComponent by default.
11
37
Map component will be used on the simulator as well.
12
38
13
39
2. Since a native component is used placing overlays is problematic. You will need to use Dialogs and the API's of the MapContainer class to implement this.
14
40
15
-
# Configuration
41
+
##Configuration
16
42
The configuration portion is the hardest part, Google made it especially painful in the Google typical way.
17
43
You can follow the instructions from Google to get started for [Android](https://developers.google.com/maps/documentation/android/start), for [iOS](https://developers.google.com/maps/documentation/ios/start/), and
18
44
for [Javascript](https://developers.google.com/maps/documentation/javascript/). UWP uses https://code.msdn.microsoft.com/windowsapps/Bing-Maps-for-Windows-10-d7ae3e44[BingMaps] instead of Google maps.
NOTE: Version 23 and higher require google play services 9.4.0 or higher, this library will automatically cause your app to build against 9.4.0 or higher. If you require compatibility with the older version (8.3.0), you'll need to install GoogleMaps.cn1lib v22 or earlier. You can download v22 [here](https://github.com/codenameone/codenameone-google-maps/releases/tag/v22).
42
68
43
69
This project was migrated from an old project on Google code http://code.google.com/p/codenameone-google-maps
This will install the library into your local maven repository so that you'll be able to add it as a dependency to any of your projects with the snippet:
86
+
87
+
~~~~
88
+
<dependency>
89
+
<groupId>com.codenameone</groupId>
90
+
<artifactId>googlemaps-lib</artifactId>
91
+
<version>THE_VERSION</version>
92
+
<type>pom</type>
93
+
</dependency>
94
+
~~~~
95
+
96
+
Just replace `THE_VERSION` with the version in the GoogleMaps/pom.xml file.
97
+
98
+
IMPORTANT: Notice that you include the `googlemaps-lib` artifact and not the `googlemaps` artifact when using it as a dependency. The root "googlemaps" artifact is just a wrapper project for the multi-module project. The "lib" module is the actual cn1lib dependency.
99
+
100
+
### Building Legacy .cn1lib File
101
+
102
+
Maven projects no longer use .cn1lib file format, however the project still builds this format in case you want to distribute the cn1lib without using Maven's dependency mechanisms (or if you want to use the library with the legacy Ant project type). When you run `mvn install` it will automatically build the cn1lib file. **You'll find it inside the common/target** directory after performing a build.
0 commit comments