maplibre / maplibre-gl-native-distribution Goto Github PK
View Code? Open in Web Editor NEWMapLibre Native for iOS distributed via the Swift Package Manager.
Home Page: https://maplibre.org
License: BSD 2-Clause "Simplified" License
MapLibre Native for iOS distributed via the Swift Package Manager.
Home Page: https://maplibre.org
License: BSD 2-Clause "Simplified" License
Hello there im trying to build the app using Appcenter and every time is stuck after this line
Build settings from command line:
CODE_SIGNING_ALLOWED = NO
Resolve Package Graph
Fetching from https://github.com/maplibre/maplibre-gl-native-distribution
Cloning local copy of package ‘maplibre-gl-native-distribution’
Checking out 5.12.1 of package ‘maplibre-gl-native-distribution’
##[error]The operation was canceled.
I am building an iOS sample app using the swisstopo vector tile example style referenced on the geo.admin.ch API description.
All I am doing in the app is this:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let mapView = MGLMapView(frame: view.bounds, styleURL: Bundle.main.url(forResource: "lbm_v1.0.0", withExtension: "json")!)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(mapView)
}
The app launches fine, but as soon as I zoom into it the app crashes with EXC_BAD_ACCESS (code=1, address=0x30)
Thread 5 Queue : com.apple.opengl.cvmDoWork (serial)
#0 0x00000001a977d858 in cvmsServerElementBuild ()
#1 0x00000001a9779c88 in cvms_element_build_from_source ()
#2 0x00000001a977067c in cvm_deferred_build_modular(void*) ()
#3 0x000000010576cf34 in _dispatch_client_callout ()
#4 0x0000000105773fbc in _dispatch_lane_serial_drain ()
#5 0x0000000105774c70 in _dispatch_lane_invoke ()
#6 0x0000000105780af4 in _dispatch_workloop_worker_thread ()
#7 0x00000001bd7f8764 in _pthread_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0 0x0000000105770c48 in _dispatch_async_f_slow ()
#1 0x00000001a976fe60 in cvmRequestFunctionPointerArrayWrite ()
#2 0x0000000107cd8038 in gldBuildFPTransformFunc ()
#3 0x0000000107cd8b98 in gldSetFPTransformFunc ()
#4 0x0000000107cea584 in gldLLVMVecPolyRender ()
#5 0x0000000107cd562c in gldRenderFillTriangles ()
#6 0x0000000107c8a674 in gleLLVMVecPrimMultiRender ()
#7 0x0000000107be53e4 in gleFlushAtomicFunc ()
#8 0x0000000107c2a334 in glDrawElements_IMM_ES2Exec ()
#9 0x00000001050ad4b8 in mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) ()
#10 0x00000001050f90f8 in mbgl::gl::Program<mbgl::LineProgram>::draw(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::DrawMode const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::width> > const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) ()
#11 0x0000000105155b70 in void mbgl::Program<mbgl::LineProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul> >, mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio>, mbgl::TypeList<>, mbgl::style::LinePaintProperties>::draw<mbgl::gfx::Triangles>(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::Triangles const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::IndexBuffer const&, std::__1::vector<mbgl::Segment<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > >, std::__1::allocator<mbgl::Segment<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > > > const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::width> > const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) ()
#12 0x0000000105152948 in mbgl::RenderLineLayer::render(mbgl::PaintParameters&) ()
#13 0x0000000105180bd0 in mbgl::Renderer::Impl::render(mbgl::RenderTree const&) ()
#14 0x000000010517f354 in mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) ()
#15 0x00000001053a82b4 in MGLRenderFrontend::render() [inlined] at /Users/runner/work/maplibre-gl-native/maplibre-gl-native/platform/ios/platform/darwin/src/MGLRendererFrontend.h:57
#16 0x00000001053a8268 in -[MGLMapView renderSync] at /Users/runner/work/maplibre-gl-native/maplibre-gl-native/platform/ios/platform/ios/src/MGLMapView.mm:981
#17 0x0000000105360c1c in MGLMapViewImpl::render() [inlined] at /Users/runner/work/maplibre-gl-native/maplibre-gl-native/platform/ios/platform/ios/src/MGLMapView+Impl.mm:14
#18 0x0000000105360c04 in -[MGLMapViewImplDelegate glkView:drawInRect:] at /Users/runner/work/maplibre-gl-native/maplibre-gl-native/platform/ios/platform/ios/src/MGLMapView+OpenGL.mm:26
#19 0x00000001a939dd10 in -[GLKView _display:] ()
#20 0x00000001053a95f4 in -[MGLMapView updateFromDisplayLink:] at /Users/runner/work/maplibre-gl-native/maplibre-gl-native/platform/ios/platform/ios/src/MGLMapView.mm:1211
#21 0x000000018754a404 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#22 0x000000018760dcbc in display_timer_callback(__CFMachPort*, void*, long, void*) ()
#23 0x000000018033134c in __CFMachPortPerform ()
#24 0x0000000180365d04 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#25 0x0000000180365138 in __CFRunLoopDoSource1 ()
#26 0x000000018035f394 in __CFRunLoopRun ()
#27 0x000000018035e58c in CFRunLoopRunSpecific ()
#28 0x000000018b9c2740 in GSEventRunModal ()
#29 0x00000001843ccbf0 in -[UIApplication _run] ()
#30 0x00000001843d19d0 in UIApplicationMain ()
#31 0x00000001b220f328 in UIApplicationMain(_:_:_:_:) ()
#32 0x0000000104c47e20 in static UIApplicationDelegate.main() ()
#33 0x0000000104c47d98 in static AppDelegate.$main() ()
#34 0x0000000104c47e64 in main ()
#35 0x0000000180223cbc in start ()
Or I am doing something horribly wrong, or something is not all right for IOS. Initial load of the map goes to 200%.
Here is the code:
struct MapView: UIViewRepresentable {
func makeUIView(context: Context) -> MGLMapView {
let styleURL = URL(string: "https://api.maptiler.com/maps/streets-v2/style.json?key=keyHere")
// create the mapview
let mapView = MGLMapView(frame: .zero, styleURL: styleURL)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
mapView.logoView.isHidden = true
mapView.setCenter(
CLLocationCoordinate2D(latitude: 47.127757, longitude: 8.579139),
zoomLevel: 10,
animated: false)
// use the coordinator only if you need
// to respond to the map events
mapView.delegate = context.coordinator
return mapView
}
func updateUIView(_ uiView: MGLMapView, context: Context) {
}
func makeCoordinator() -> MapView.Coordinator {
Coordinator(self)
}
class Coordinator: NSObject, MGLMapViewDelegate {
var control: MapView
init(_ control: MapView) {
self.control = control
}
private func mapViewDidFinishLoadingMap(_ mapView: MapView) {
// write your custom code which will be executed
// after map has been loaded
}
}
}
And here is Cpu image (btw this is both on phone and simulator):
And one from profiler
So what could be the problem here?
I used 5.9.0, 5.10.0 version.
But I can't change language.
mapView?.style?.localizeLabels(into: Locale(identifier: lang))
lang
string was set ja_JP
, zh_TW
.
Hi, I am trying to load a MapTiler on the Apple Watch. I was able to run the example for iPhone but when I add this library to the apple watch I have an issue in the linker (I suppose).
While building for watchOS Simulator, no library for this platform was found in '/Users/ema/Library/Developer/Xcode/DerivedData/HikeWatch-dtyymecyspaowuhahtyhhxfliemm/SourcePackages/artifacts/maplibre-gl-native/MapboxMobileEvents.xcframework'.
While building for watchOS Simulator, no library for this platform was found in '/Users/ema/Library/Developer/Xcode/DerivedData/HikeWatch-dtyymecyspaowuhahtyhhxfliemm/SourcePackages/artifacts/maplibre-gl-native/Mapbox.xcframework'.
I tried to build it also for real Watch and not the simulator but the result is the same.
The MapLibre project provides iOS binaries for both x86_64
& arm64
which allows for Simulator development on either Intel or Apple Silicon architectures.
When using the Mapbox.xcframework
for a 3rd party map project, there are several issues when targeting the iOS Simulator for arm64
.
Issues
arm64
iOS Simulators 14.5 & 16.0 have a drawing error that is eventually fixed when the map is at steady state.arm64
iOS Simulators 15.4 & 15.5 have a drawing error, followed by an exception when moving the map.x86_64
iOS Simulators fixes drawing & exception issues for SDKs 14.5, 15.4, 15.5, & 16.0.Questions
EXCLUDED_ARCHS
, and force targeting x86_64
seem to be the accepted workaround for Simulators on Apple Silicon?
EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64
'cyclone' is not a recognized processor for this target (ignoring processor)
? These are fixed when targeting x86_64
.Test environment
arm64
Four iOS Simulators:
x86_64
Four iOS Simulators:
Mapbox.xcframework
lipo information# lipo -info Mapbox.xcframework/ios-arm64_armv7/Mapbox.framework/Mapbox
Architectures in the fat file: Mapbox.xcframework/ios-arm64_armv7/Mapbox.framework/Mapbox are: armv7 arm64
# lipo -info Mapbox.xcframework/ios-arm64_i386_x86_64-simulator/Mapbox.framework/Mapbox
Architectures in the fat file: Mapbox.xcframework/ios-arm64_i386_x86_64-simulator/Mapbox.framework/Mapbox are: x86_64 i386 arm64
Mapbox.xcframework
for devices & simulators.
arm64
Simulator throws many not recognized processors.
'cyclone' is not a recognized processor for this target (ignoring processor)'cyclone' is not a recognized processor for this target (ignoring processor)
'cyclone' is not a recognized processor for this target (ignoring processor)
This issue shows the MapLibre for Swift Playgrounds changes.
This allows macOS users to explore MapLibre without requiring to build from source nor have an app to test styles and the snapshot features.
Example MapLibre map with several MGLMapDebugMaskOptions
enabled.
Example using MGLMapSnapshotter
to take a snapshot with a customer MGLMapCamera
.
Update the About section of this Repo's home page with this text
An open-source fork of Mapbox GL SDK for iOS and Android
Rationale: This gives users in Xcode's Swift Package Manager that they are confidently using the proper binaries.
When filing out the About section of the home page for https://github.com/maptiler/maplibre-gl-native-distribution, Apple Xcode will make use that text to give the user a description.
In our current repo, there is no description.
Example of how the Swift Package looks when adding the v10
Mapbox Maps SDK for iOS
Hello!
I'm facing issue drawing circles with some radius on the map.
The main problem, that I can't find any Circle
class in the library. Currently I'm drawing circles using MGLPolygon
. But I can't make its border more that 1 pt width. Calling delegate:
func mapView(_ mapView: MGLMapView, lineWidthForPolylineAnnotation annotation: MGLPolyline) -> CGFloat
but width of polygon border is not changing, its always 1 pt.
What I'm trying achieve is something like this:
Code that draws Circle using Polygon:
final class CircleShapeAnnotation: MGLPolygon {
var id: String?
static func makePolygon(coordinate: CLLocationCoordinate2D, withMeterRadius: Double, id: String) -> CircleShapeAnnotation {
let degreesBetweenPoints = 4.0
let numberOfPoints = floor(360.0 / degreesBetweenPoints)
let distRadians: Double = withMeterRadius / 6371000.0
let centerLatRadians: Double = coordinate.latitude * Double.pi / 180
let centerLonRadians: Double = coordinate.longitude * Double.pi / 180
var coordinates = [CLLocationCoordinate2D]()
for index in 0 ..< Int(numberOfPoints) {
let degrees: Double = Double(index) * Double(degreesBetweenPoints)
let degreeRadians: Double = degrees * Double.pi / 180
let pointLatRadians: Double = asin(sin(centerLatRadians) * cos(distRadians) + cos(centerLatRadians) * sin(distRadians) * cos(degreeRadians))
let pointLonRadians: Double = centerLonRadians + atan2(sin(degreeRadians) * sin(distRadians) * cos(centerLatRadians), cos(distRadians) - sin(centerLatRadians) * sin(pointLatRadians))
let pointLat: Double = pointLatRadians * 180 / Double.pi
let pointLon: Double = pointLonRadians * 180 / Double.pi
let point: CLLocationCoordinate2D = CLLocationCoordinate2DMake(pointLat, pointLon)
coordinates.append(point)
}
let circle = CircleShapeAnnotation(coordinates: &coordinates, count: UInt(coordinates.count))
circle.id = id
return circle
}
}
Hi, I'm getting an error after integrating the SPM package:
dyld: Library not loaded: @rpath/Mapbox.framework/Mapbox
Referenced from: /private/var/containers/Bundle/Application/78B0CD80-E815-4338-9416-DFBBFC5C2C87/Connect.app/Frameworks/Map.framework/Map
Reason: image not found
Perhaps it's an Xcode bug? https://developer.apple.com/forums/thread/652873
Edit: I'm using:
Can this be renamed to MapLibre? It shows up like this right now:
I used Mapbox's tutorial at https://docs.mapbox.com/ios/legacy/maps/examples/clustering/ to show Marker Cluster but mapView only show nonCluster point like picture below.
I'm using newest version 5.13.0
Please help me with this issue!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.