iOS Question WebWiev Javascript problem

jefflynn1974

Member
Licensed User
Longtime User
Hi there
I want to display a map in a webwiev (or WkWebWiev) with the following html code.
Code: Copy
<!DOCTYPE HTML>
<title>OpenLayers Simplest Example</title>
<div id='demoMap' style='height:250px'></div>
<script src='https://www.openlayers.org/api/OpenLayers.js'></script>
<script>
    map = new OpenLayers.Map('demoMap');
    map.addLayer(new OpenLayers.Layer.OSM());
    map.zoomToMaxExtent();
</script>
All I get is a blank webview. No error messages neither in B4i log nor in system log on my Mac.
I'm using this line:
Code: Copy
WKWebView1.LoadHtml("<!DOCTYPE HTML> <title>OpenLayers Simplest Example</title> <div id='demoMap' style='height:250px'></div> <script src='https://www.openlayers.org/api/OpenLayers.js'></script>")
So my questions are: how to get the error messages? and how to display a map in (Wk)WebWiev?
 
I'm answering my own questions, it might be useful for others.
1. The error messages can be seen in Safari development tab - Simulator - Device name ...
2. The reason was App Transport Security, for more info read this
 
Upvote 0
Back
Top