Skip to content

Commit 789edbd

Browse files
authored
Update README.md
1 parent 49e2090 commit 789edbd

1 file changed

Lines changed: 41 additions & 91 deletions

File tree

README.md

Lines changed: 41 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
[![MapLibre Logo](https://maplibre.org/img/maplibre-logo-big.svg)](https://maplibre.org/)
1+
# MapMetrics Native
22

3-
# MapLibre Native
3+
[![codecov](https://codecov.io/github/maplibre/maplibre-native/branch/main/graph/badge.svg?token=8ZQRRY56ZA)](https://codecov.io/github/maplibre/maplibre-native)
44

5-
[![codecov](https://codecov.io/github/maplibre/maplibre-native/branch/main/graph/badge.svg?token=8ZQRRY56ZA)](https://codecov.io/github/maplibre/maplibre-native) [![](https://img.shields.io/badge/Slack-%23maplibre--native-2EB67D?logo=slack)](https://slack.openstreetmap.us/)
6-
7-
MapLibre Native is a free and open-source library for publishing maps in your apps and desktop applications on various platforms. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.
5+
MapMetrics Native is a free and open-source library for publishing maps in your apps and desktop applications on various platforms. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.
86

97
This project originated as a fork of Mapbox GL Native, before their switch to a non-OSS license in December 2020. For more information, see: [`FORK.md`](./FORK.md).
108

11-
<p align="center">
12-
<img src="https://user-images.githubusercontent.com/649392/211550776-8779041a-7c12-4bed-a7bd-c2ec80af2b29.png" alt="Android device with MapLibre" width="24%"> <img src="https://user-images.githubusercontent.com/649392/211550762-0f42ebc9-05ab-4d89-bd59-c306453ea9af.png" alt="iOS device with MapLibre" width="25%">
13-
</p>
149

1510
## Getting Started
1611

1712
### Android
1813

19-
Add [the latest version](https://central.sonatype.com/artifact/org.maplibre.gl/android-sdk/versions) of MapLibre Native Android as a dependency to your project.
14+
Add [the latest version](https://central.sonatype.com/artifact/org.maplibre.gl/android-sdk/versions) of MapMetrics Native Android as a dependency to your project.
2015

2116
```gradle
2217
dependencies {
2318
...
24-
implementation 'org.maplibre.gl:android-sdk:11.8.5'
19+
implementation 'org.mapmetrics.android-sdk:$latest-version'
2520
...
2621
}
2722
```
@@ -37,7 +32,7 @@ Add a `MapView` to your layout XML file:
3732
```
3833

3934
> [!TIP]
40-
> There are external projects such as [Ramani Maps](https://github.com/ramani-maps/ramani-maps) and [MapLibre Compose Playground](https://github.com/Rallista/maplibre-compose-playground) available to intergrate MapLibre Native Android with Compose-based projects.
35+
> There are external projects such as [Ramani Maps](https://github.com/ramani-maps/ramani-maps) and [MapLibre Compose Playground](https://github.com/Rallista/maplibre-compose-playground) available to intergrate MapMetrics Native Android with Compose-based projects.
4136
4237
Next, initialize the map in an activity:
4338

@@ -53,27 +48,36 @@ import org.maplibre.android.geometry.LatLng
5348
import org.maplibre.android.maps.MapView
5449
import org.maplibre.android.testapp.R
5550

56-
class MainActivity : AppCompatActivity() {
51+
class SimpleMapActivity : AppCompatActivity() {
5752

5853
// Declare a variable for MapView
5954
private lateinit var mapView: MapView
6055

6156
override fun onCreate(savedInstanceState: Bundle?) {
6257
super.onCreate(savedInstanceState)
63-
64-
// Init MapLibre
65-
MapLibre.getInstance(this)
66-
67-
// Init layout view
68-
val inflater = LayoutInflater.from(this)
69-
val rootView = inflater.inflate(R.layout.activity_main, null)
70-
setContentView(rootView)
71-
72-
// Init the MapView
73-
mapView = rootView.findViewById(R.id.mapView)
74-
mapView.getMapAsync { map ->
75-
map.setStyle("https://demotiles.maplibre.org/style.json")
76-
map.cameraPosition = CameraPosition.Builder().target(LatLng(0.0,0.0)).zoom(1.0).build()
58+
onBackPressedDispatcher.addCallback(this, object: OnBackPressedCallback(true) {
59+
override fun handleOnBackPressed() {
60+
// activity uses singleInstance for testing purposes
61+
// code below provides a default navigation when using the app
62+
NavUtils.navigateHome(this@SimpleMapActivity)
63+
}
64+
})
65+
setContentView(R.layout.activity_map_simple)
66+
mapView = findViewById(R.id.mapView)
67+
mapView.onCreate(savedInstanceState)
68+
mapView.getMapAsync {
69+
val key = ApiKeyUtils.getApiKey(applicationContext)
70+
if (key == null || key == "YOUR_API_KEY_GOES_HERE") {
71+
it.setStyle(
72+
Style.Builder().fromUri(style)
73+
)
74+
} else {
75+
val styles = Style.getPredefinedStyles()
76+
if (styles.isNotEmpty()) {
77+
val styleUrl = styles[0].url
78+
it.setStyle(Style.Builder().fromUri(styleUrl))
79+
}
80+
}
7781
}
7882
}
7983

@@ -119,9 +123,9 @@ For more information, refer to the [Android API Documentation](https://maplibre.
119123

120124
## iOS
121125

122-
You can find MapLibre Native iOS on [Cocoapods](https://cocoapods.org/) and on the [Swift Package Index](https://swiftpackageindex.com/maplibre/maplibre-gl-native-distribution). You can also MapLibre Native iOS [as a dependency to Xcode directly](https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre-native-for-ios/gettingstarted/#Add-MapLibre-Native-as-a-dependency).
126+
You can find MapMetrics Native iOS on [Cocoapods](https://cocoapods.org/) and on the [Pods](https://cocoapods.org/pods/MapMetrics).
123127

124-
MapLibre Native iOS uses UIKit. To intergrate it with an UIKit project, you can use
128+
MapMetrics Native iOS uses UIKit. To intergrate it with an UIKit project, you can use
125129

126130
```swift
127131
class SimpleMap: UIViewController, MLNMapViewDelegate {
@@ -143,7 +147,7 @@ class SimpleMap: UIViewController, MLNMapViewDelegate {
143147
You need to create a wrapper when using SwiftUI.
144148

145149
```swift
146-
import MapLibre
150+
import MapMetrics
147151

148152
struct SimpleMap: UIViewRepresentable {
149153
func makeUIView(context _: Context) -> MLNMapView {
@@ -155,40 +159,25 @@ struct SimpleMap: UIViewRepresentable {
155159
}
156160
```
157161

158-
> [!TIP]
159-
> You can also use [MapLibreSwiftUI](https://github.com/maplibre/swiftui-dsl), a wrapper around MapLibre Native iOS that offers a declarative API like SwiftUI.
160-
161162
The [iOS Documentation](https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre/) contains many examples and the entire API of the library.
162163

163-
## Node.js
164-
165-
There is an [npm package](https://www.npmjs.com/package/@maplibre/maplibre-gl-native) for using MapLibre Native in a Node.js project. The source code of this project [can be found in this repository](https://github.com/maplibre/maplibre-native/tree/main/platform/node).
166-
167-
## Qt
168-
169-
Please check out the [`maplibre/maplibre-native-qt` repository](https://github.com/maplibre/maplibre-native-qt) to learn how to intergrate MapLibre Native with a Qt project.
170-
171-
## Other Platforms
172-
173-
MapLibre Native can also be built on [Linux](platform/linux/README.md), [Windows](platform/windows/README.md) and [macOS](platform/macos/README.md).
174-
175164
## Contributing
176165

177166
> [!NOTE]
178-
> This section is only relevant for people who want to contribute to MapLibre Native.
167+
> This section is only relevant for people who want to contribute to MapMetrics Native.
179168
180-
MapLibre Native has at its core a C++ library. This is where the bulk of development is currently happening.
169+
MapMetrics Native has at its core a C++ library. This is where the bulk of development is currently happening.
181170

182171
To get started with the code base, you need to clone the the repository including all its submodules.
183172

184173
All contributors use pull requests from a private fork. [Fork the project](https://github.com/maplibre/maplibre-native/fork). Then run:
185174

186175
```bash
187-
git clone --recurse-submodules git@github.com:<YOUR NAME>/maplibre-native.git
188-
git remote add origin https://github.com/maplibre/maplibre-native.git
176+
git clone --recurse-submodules git@github.com:<YOUR NAME>/mapmetrics-native-sdk.git
177+
git remote add origin https://github.com/maplibre/mapmetrics-native-sdk.git
189178
```
190179

191-
The go-to reference is the [MapLibre Native Developer Documentation](https://maplibre.org/maplibre-native/docs/book/).
180+
The go-to reference is the [MapMetrics Native Developer Documentation](https://maplibre.org/maplibre-native/docs/book/).
192181

193182
> [!TIP]
194183
> Check out issues labelled as a [good first issue](https://github.com/maplibre/maplibre-native/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
@@ -203,7 +192,7 @@ The go-to reference is the [MapLibre Native Developer Documentation](https://map
203192

204193
Open `platform/android` with Android Studio.
205194

206-
More information: [MapLibre Android Developer Guide](https://maplibre.org/maplibre-native/docs/book/platforms/android/index.html).
195+
More information: [MapMetrics Android Developer Guide](https://maplibre.org/maplibre-native/docs/book/android/index.html).
207196

208197
### iOS
209198

@@ -216,52 +205,13 @@ xed platform/ios/MapLibre.xcodeproj
216205

217206
To generate and open the Xcode project.
218207

219-
More information: [MapLibre iOS Developer Guide](https://maplibre.org/maplibre-native/docs/book/platforms/ios/index.html).
208+
More information: [MapMetrics iOS Developer Guide](https://maplibre.org/maplibre-native/docs/book/ios/index.html).
220209

221210
## Other Platforms
222211

223212
See [`/platform`](/platform) and navigate to the platform you are interested in for more information.
224213

225-
## Getting Involved
226-
227-
Join the `#maplibre-native` Slack channel at OSMUS. Get an invite at https://slack.openstreetmap.us/
228-
229-
### Bounties 💰
230-
231-
Thanks to our sponsors, we are able to award bounties to developers making contributions toward certain [bounty directions](https://github.com/maplibre/maplibre/issues?q=is%3Aissue+is%3Aopen+label%3A%22bounty+direction%22). To get started doing bounties, refer to the [step-by-step bounties guide](https://maplibre.org/roadmap/step-by-step-bounties-guide/).
232-
233-
We thank everyone who supported us financially in the past and special thanks to the people and organizations who support us with recurring donations!
234-
235-
Read more about the MapLibre Sponsorship Program at [https://maplibre.org/sponsors/](https://maplibre.org/sponsors/).
236-
237-
Gold:
238-
239-
<a href="https://aws.amazon.com/location"><img src="https://maplibre.org/img/aws-logo.svg" alt="Logo AWS" width="25%"/></a>
240-
241-
<a href="https://meta.com"><img src="https://maplibre.org/img/meta-logo.svg" alt="Logo Meta" width="25%"/></a>
242-
243-
Silver:
244-
245-
<a href="https://www.mierune.co.jp/?lang=en"><img src="https://maplibre.org/img/mierune-logo.svg" alt="Logo MIERUNE" width="25%"/></a>
246-
247-
<a href="https://komoot.com/"><img src="https://maplibre.org/img/komoot-logo.svg" alt="Logo komoot" width="25%"/></a>
248-
249-
<a href="https://www.jawg.io/"><img src="https://maplibre.org/img/jawgmaps-logo.svg" alt="Logo JawgMaps" width="25%"/></a>
250-
251-
<a href="https://www.radar.com/"><img src="https://maplibre.org/img/radar-logo.svg" alt="Logo Radar" width="25%"/></a>
252-
253-
<a href="https://www.microsoft.com/"><img src="https://maplibre.org/img/msft-logo.svg" alt="Logo Microsoft" width="25%"/></a>
254-
255-
<a href="https://www.mappedin.com/"><img src="https://maplibre.org/img/mappedin-logo.svg" alt="Logo mappedin" width="25%"/></a>
256-
257-
<a href="https://www.mapme.com/"><img src="https://maplibre.org/img/mapme-logo.svg" alt="Logo mapme" width="25%"/></a>
258-
259-
<a href="https://www.maptiler.com/"><img src="https://maplibre.org/img/maptiler-logo.svg" alt="Logo maptiler" width="25%"/></a>
260-
261-
Backers and Supporters:
262-
263-
[![](https://opencollective.com/maplibre/backers.svg?avatarHeight=50&width=600)](https://opencollective.com/maplibre)
264214

265215
## License
266216

267-
**MapLibre Native** is licensed under the [BSD 2-Clause License](./LICENSE.md).
217+
**MapMetrics Native** is licensed under the [BSD 2-Clause License](./LICENSE.md).

0 commit comments

Comments
 (0)