Coder Social home page Coder Social logo

openmobilemaps / maps-core Goto Github PK

View Code? Open in Web Editor NEW
145.0 8.0 16.0 9.4 MB

The lightweight and modern Map SDK for Android and iOS

Home Page: https://openmobilemaps.io

License: Mozilla Public License 2.0

Swift 5.72% CMake 0.19% C++ 90.70% C 0.23% Kotlin 1.93% Shell 0.10% Makefile 0.01% Metal 1.13%
maps sdk android ios opengl metal

maps-core's Introduction

Open Mobile Maps




The lightweight and modern Map SDK for Android (8.0+, OpenGl ES 3.2) and iOS (11+)

openmobilemaps.io

Features

  • Multi-platform graphics engine based on OpenGL for Android and Metal for iOS
  • Touch and gesture handling
  • Tiled Map Layers
  • Vector Layers
  • Polygon Layers
  • Icon Layers

...and more to come! See our roadmap at openmobilemaps.io

Getting started

Get started using Open Mobiles Maps by integrating a map into an Android or iOS project.

Readme Android

Readme iOS

Architecture

Architecture describes, how C++ is used to shared most of the codebase between the two platforms.

License

This project is licensed under the terms of the MPL 2 license. See the LICENSE file.

maps-core's People

Contributors

bastianmorath avatar benz-ubique avatar fbzli avatar friedrich-ubique avatar gallmann-ubique avatar m-wong avatar maerki avatar maurhofer-ubique avatar simonroesch avatar stmitt avatar ubfelix avatar zenokoller avatar zimmermannubique avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maps-core's Issues

Support for vector tiles rendering in SceneKit

Do you plan to add support for vector tiles rendering using SceneKit? If not, do you have any recommendations on where to start with adding this support to your project (I'm considering to start contributing)? Maybe you investigated it in the past and have some useful tips.

The reason why this support would be beneficial is for Apple Watch usecases. The newest Apple Watch releases (especially the Ultra model) have large screens and good CPUs suitable for map displaying. There are countless outdoor applications which could be implemented with the help of your library. Unfortunately there's no support for Metal and Open GL on watchOS and SceneKit seems to be the only feasible alternative.

It would be also great if you support reading from vector tiles saved offline (e.g. in .mbtiles format). Do you have this on your roadmap?

Memory leak io.openmobilemaps.mapscore.map.scheduling.AndroidScheduler

1 APPLICATION LEAKS

References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.

70983 bytes retained by leaking objects
Signature: 15573cc6c74bad714652a49c1f8ad11864b2df03
┬───
│ GC Root: Global variable in native code
│
├─ io.openmobilemaps.mapscore.map.scheduling.AndroidScheduler instance
│ Leaking: UNKNOWN
│ Retaining 508 B in 20 objects
│ ↓ AndroidScheduler.schedulerCallback
│ ~~~~~~~~~~~~~~~~~
├─ ch.admin.geo.openswissmaps.view.SwisstopoMapView instance
│ Leaking: UNKNOWN
│ Retaining 73.6 kB in 1815 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.map
│ View.mWindowAttachCount = 0
│ mContext instance of my.app.package.MainActivity with mDestroyed = false
│ ↓ View.mParent
│ ~~~~~~~
╰→ androidx.constraintlayout.widget.ConstraintLayout instance
​ Leaking: YES (ObjectWatcher was watching this because my.app.package.
​ MyFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent
​ leaks))
​ Retaining 71.0 kB in 1763 objects
​ key = e918977a-17b9-4a19-b6d3-aabc655dc358
​ watchDurationMillis = 16756
​ retainedDurationMillis = 11756
​ View not part of a window view hierarchy
​ View.mAttachInfo is null (view detached)
​ View.mWindowAttachCount = 0
​ mContext instance of my.app.package.MainActivity with mDestroyed = false
0 LIBRARY LEAKS

A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
0 UNREACHABLE OBJECTS

An unreachable object is still in memory but LeakCanary could not find a strong reference path
from GC roots.
METADATA

Please include this in bug reports and Stack Overflow questions.

Build.VERSION.SDK_INT: 31
Build.MANUFACTURER: samsung
LeakCanary version: 2.9.1
App process name: my.app.package
Class count: 39381
Instance count: 384319
Primitive array count: 203574
Object array count: 61050
Thread count: 189
Heap total bytes: 46460491
Bitmap count: 19
Bitmap total bytes: 4784147
Large bitmap count: 0
Large bitmap total bytes: 0
Stats: LruCache[maxSize=3000,hits=161019,misses=368571,hitRate=30%]
RandomAccess[bytes=19735710,reads=368571,travel=231660715383,range=56409567,size=66972769]
Analysis duration: 20665 ms
Heap dump timestamp: 1680076297608
Heap dump duration: Unknown

How to test 3D map?

Is it possible to test 3D Map now? Just want to test the lib.
I checked out release/3.0.0 branch and init the map:

class ViewController: UIViewController {
    lazy var mapView = MCMapView(is3D: true)
    override func loadView() { view = mapView }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        mapView.add(layer: TiledRasterLayer("osm", webMercatorUrlFormat: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"))
        
        mapView.camera.move(toCenterPositionZoom: MCCoord(lat: 46.962592372639634, lon: 8.378232525377973), zoom: 1000000, animated: true)
    }
}

But I'm seeing just black screen.
Can you help with that?

Sample App

Adding A Sample Will Be Nice To Guide.

iOS memory leak

Hi there.
When I deinit the enclosing view controller the memory is not being deallocated. Any idea?

IllegalStateException

During runtime we discovered this exception within our crashlytics, we're using the lib-open-swiss-maps-sdk version 1.1.4:

Fatal Exception: java.lang.IllegalStateException: GpsLayer is already destroyed!
at io.openmobilemaps.gps.GpsLayer.requireLayerInterface(GpsLayer.kt:1)
at io.openmobilemaps.gps.GpsLayer.onCompassUpdate(GpsLayer.kt:1)
at io.openmobilemaps.gps.compass.CompassProvider.onSensorChanged(CompassProvider.kt:11)
at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:982)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java

With the following Device: Samsung Galaxy A52 with Android 12

set zoom not working since 2.0.1

I update package to 2.0.1 since that self.mapView.camera.setZoom not working as expected
setZoom only work in viewDidLoad but not in button action or anything else

RUN TIME ERROR

JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "io.openmobilemaps.mapscore.shared.MapsCoreSharedModule$CppProxy" on
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:230)

MY CODE IS :
FRAGMENT:
binding.mapViewDealers.setupMap(MapConfig(CoordinateSystemFactory.getEpsg3857System()))
binding.mapViewDealers.registerLifecycle(lifecycle)

XML:
<io.openmobilemaps.mapscore.map.view.MapView
android:id="@+id/mapViewDealers"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

Zoom value is always 1

I followed the README.md example in order to get the map to work using an open street map URL but the Tiled2dMapLayerConfig always returns 1 as the zoom.
My getTileUrl() function looks like this:

 override fun getTileUrl(x: Int, y: Int, zoom: Int): String {
            Log.d(TAG, "getTileUrl x:$x , y:$y , zoom:$zoom")
            return"https://tile.openstreetmap.org/$zoom/$x/$y.png"
        }

The logs tell me that the zoom is always 1 even if I pinch zoom in or out:
getTileUrl x:1081 , y:659 , zoom:1
The Map looks like this:
activity_open_mobile_maps_dynamic

If I hardcode the zoom value to 15 for example:

 override fun getTileUrl(x: Int, y: Int, zoom: Int): String {
            Log.d(TAG, "getTileUrl x:$x , y:$y , zoom:$zoom")
            return"https://tile.openstreetmap.org/15/$x/$y.png"
        }

I initially see only ocean:
activity_open_mobile_maps_zoomed_out_hardcoded

but if I zoom in using pinch gestures I can at some point see the map:
activity_open_mobile_maps_zoomed_in_hardcoded

I uploaded the Activity here.

Any idea how I can make it work?

Location use

Do you use only gps for location or also other location options?

Thanks :)

Couldn't get targetSdkVersion for package com.android.accelerometergraph

I encounter a lot of crashes/exceptions during runtime:

E/JavaBinder: *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
java.lang.RuntimeException: android.os.RemoteException: Couldn't get targetSdkVersion for package com.android.accelerometergraph
at android.os.Parcel.writeException(Parcel.java:2222)
at android.os.Binder.execTransactInternal(Binder.java:1239)
at android.os.Binder.execTransact(Binder.java:1179)
Caused by: android.os.RemoteException: Couldn't get targetSdkVersion for package com.android.accelerometergraph
at com.android.server.pm.PackageManagerService$PackageManagerNative.getTargetSdkVersionForPackage(PackageManagerService.java:32748)
at android.content.pm.IPackageManagerNative$Stub.onTransact(IPackageManagerNative.java:297)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179) 
E/inertial-anchor: [CalibrationManager]: Unknown sensor_type used in SetCalibration.

Samsung Galaxy A52 with Android 12
lib-open-swiss-maps-sdk version 1.1.4:

Issue in lineCap poyline in iOS

when I draw polyine in iOS it looks like this
how I can make smooth linked join for polyline
lineCap.ROUND not work as expected
Screenshot 2024-04-05 at 22 23 29

Screenshot 2024-04-05 at 22 23 29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.