osm_flutter
osm_flutter copied to clipboard
What causes the map to black out?
My program blacked out the map, so I tried it with '/example/lib/src/home/home_example.dart' and it looks the same. Do you know the cause?
that problem in rendering engine in map sdk i will check it
are you still facing the same problem? because i tested and i didn't face black screen
Sorry for the late reply.
The map blackout is still going on.
I got the following error and fixed it manually.
~~ / development / flutter / .pub-cache / hosted / pub.dartlang.org/flutter_osm_plugin-0.29.1+3/ios/Classes/Extension.swift: 225: 37: error: binary operator'-' cannot be applied to operands of type'Double' and'CGFloat' let size = CGPoint (x: width-(rect.minX --rect.maxX), y: height-(rect.minY --rect.maxY))
⇒let size = CGPoint (x: CGFloat (width)-(rect.minX --rect.maxX), y: CGFloat (height)-(rect.minY --rect.maxY))
~~/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_osm_plugin-0.29.1+3/ios/Classes/MyMapView.swift:782:100: error: cannot convert value of type 'CGFloat' to expected argument type 'Double' let bounding = mapView.getBounds(width: mainView.bounds.width, height: mainView.bounds.height)
⇒let bounding = mapView.getBounds(width: Double(mainView.bounds.width), height: Double(mainView.bounds.height))
Is this the cause?
ok i will fix that
if you're working on mac, you can overcome the problem temporary by open your project on XCode and in Pods folder try to find MyMapView.swift inside of flutter_osm_plugin folder and switch this line
let bounding = mapView.getBounds(width: mainView.bounds.width, height: mainView.bounds.height)
to
let bounding = mapView.getBounds(width: Double(mainView.bounds.width), height: Double(mainView.bounds.height))
rebuild the project
thank you. I will try it.
I get an error in two places, and if I change it as follows, no error appears.
let size = CGPoint (x: width-(rect.minX --rect.maxX), y: height-(rect.minY --rect.maxY)) ⇒let size = CGPoint (x: CGFloat (width)-(rect.minX --rect.maxX), y: CGFloat (height)-(rect.minY --rect.maxY))
let bounding = mapView.getBounds(width: mainView.bounds.width, height: mainView.bounds.height) ⇒let bounding = mapView.getBounds(width: Double(mainView.bounds.width), height: Double(mainView.bounds.height))
However, the map has been blacked out.
Flutter 2.8.1 Dart 2.15.1 Xcode 12.5.1
Thank you.
when you do that, the map return working normally or you face another problem ?
The problem hasn't changed. The controller is working and it seems that only the map part is not displayed.
controller.setMarkerIcon controller.centerMap controller.removeMarker etc ... These are working.
Sorry for the late reply, I want you to open your project with XCode and search in pods folder for flutter_osm_plugin try to find the file MyMapView and uncommend the lines 98 and 99 and comment the lines 100 and 100 and after that run your application and told me if the map shows or not
Thanks for your comment. Uncommented lines 98,99 and commented out lines 97,100.
The map is working. Do you know the cause of the blackout?
i think the problem is related to style file that i'm using to customize the map and render the raster tile because that sdk can render vector tile also. so i need to make style file can be reach over the internet and maybe theengine faced a problem to access to it because i using shared file in dropbox :disappointed_relieved:
try to return it back like it was before the changes and told me it return black screen or still working
I commented out and uncommented back. After all, the map will be blacked out.
keep the way where the map is working i will find another solution for raster tile i will published in next version
Thank you very much. waiting for the next version.
if you can test this demo in appetize and see if the map working
https://appetize.io/embed/the9m0c2mz7pm9j0ex67h8jh00?device=iphonex&osVersion=15.0&scale=75
because i made multiple test it with old way because i tried to used local asset in ios but it didn't work
just told if it work with that line
and also
can you run pod update
in terminal in ios folder and try to uncomment the previous lines (97,100) and build the application
I want just to make sure that you are using the last sdks in ios
and told me if the black screen still exist after
Sorry for too late reply. I have connected and debugged the actual iPhone, but the map does not show up. (IOS15.2) I don't know about appetize as I have never tried it, but I will try it.
Since I can't confirm the display on IOS, I had been developing on Android. (Run on Android emulator)
The app shuts down as shown below, do you know why? (This situation happened suddenly)
I/OsmDroid( 4338): Using tile source: Mapnik
I/OsmDroid( 4338): Tile cache increased from 0 to 9
E/osm ( 4338): osm flutter plugin create
E/osm ( 4338): osm flutter plugin start
E/osm ( 4338): osm flutter plugin resume
E/BufferQueueProducer( 4338): SurfaceTexture-0-4338-1 dequeueBuffer: BufferQueue has been abandoned
E/AndroidRuntime( 4338): FATAL EXCEPTION: main
E/AndroidRuntime( 4338): Process: com.---.app PID: 4338
E/AndroidRuntime( 4338): java.lang.NullPointerException: Attempt to invoke virtual method 'org.osmdroid.views.MapViewRepository org.osmdroid.views.MapView.getRepository()' on a null object reference
E/AndroidRuntime( 4338): at org.osmdroid.views.overlay.infowindow.InfoWindow.
Connected iphone (IOS15.2), the emulator showed the map. I haven't figured out why yet, but I'm glad anyway. I'm going to proceed with the development.
what is the version that you're using ? and can you share small sample to understand you use case more and i will try to look deep into the log
Hey I have the same problem running on iOS version 13.7 on an iPad. the screen is blacked out. Do I still need to uncomment the lines as you have described above ? seems to work fine in newer version of iOS above 14. however it did work the first time, now it keeps giving black screen.
// let sceneUpdates = [TGSceneUpdate]()
let sceneUpdates = [TGSceneUpdate(path: "global.sdk_api_key", value: "qJz9K05vRu6u_tK8H3LmzQ")]
let sceneUrl = URL(string: "https://www.nextzen.org/carto/bubble-wrap-style/9/bubble-wrap-style.zip")!
//let sceneUrl = URL(string: //"https://dl.dropboxusercontent.com/s/25jzvtghx0ac2rk/osm-style.zip?dl=0")!
mapView.loadSceneAsync(from: sceneUrl, with: sceneUpdates)
Anyways uncommenting and commenting helped. by the way it now shows a better map style with 3D buildings, how can I enable this in android ?
in android using another sdk but im planning to add that also for android and for blackscreen because style file maybe not downloaded maybe dropbix blocking access i will check it and i will try to fix that for all sorry for that
try the ney version now, i changed the location of styles