- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm developing an app using leaflet.js. When I test it on the emulators for Android, the layer control shows up, but it does not show up on IOS devices. I need to know if this is an emulator problem, or a real problem with the app. Leaflet uses a different image for IOS devices. Does the emulator not provide the device information for IOS so the app can know which image to render? I'm doing this on a Windows machine. Does that limit the way the iPhone emulator identifies itself?
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding your question about the Emulate tab identifying itself to the app: the userAgent string is changed to try and simulate an iOS device, when you choose an iOS device (this is also done to identify the Android and Windows devices). The userAgent string is fixed, you can't manipulate. Just type navigator.userAgent in the debug console when using the Emulate tab and you'll see what I mean. If leaflet.js is using this string to ID the device, it should recognize the iOS devices appropriately. If it is using some other technique, it will probably fail.
Note, also, that the Emulate tab always runs you code inside of a captive Chromium browser. This is not the same as the Safari embedded webview that is on a real device. So if leaflet.js has code that tries to use different features of the runtime based on the platform, that code coud fail. See these articles for some more background:
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The emulator is really a simulator. There are things that will work differently on device when built as a Cordova app. There are many things that we do not have control over, and this could be one of those issues.
1. Have you tried running your app in App Preview? Did it work correctly there?
2. Have you tried building your app and running on an actual iOS device?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. It works correctly in App Preview on an Android device. I've just been doing Android development and don't have an IOS device. Your answer leads me to believe it might be an emulator issue. I'll continue development and build a more complete version for IOS and have a friend test it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding your question about the Emulate tab identifying itself to the app: the userAgent string is changed to try and simulate an iOS device, when you choose an iOS device (this is also done to identify the Android and Windows devices). The userAgent string is fixed, you can't manipulate. Just type navigator.userAgent in the debug console when using the Emulate tab and you'll see what I mean. If leaflet.js is using this string to ID the device, it should recognize the iOS devices appropriately. If it is using some other technique, it will probably fail.
Note, also, that the Emulate tab always runs you code inside of a captive Chromium browser. This is not the same as the Safari embedded webview that is on a real device. So if leaflet.js has code that tries to use different features of the runtime based on the platform, that code coud fail. See these articles for some more background:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, this is great information. I'm finding that leaflet.js expects some default UI styles that the AppFramework UI is changing, so it might also be a CSS issue. It's been difficult to track these down, but the debugger has been a great tool to do it.
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page