AnsweredAssumed Answered

Mapbox WebViewer in Card Window

Question asked by neil.simpson@me.com on Jan 10, 2018
Latest reply on Nov 7, 2018 by TSGal

Hi all,

 

Trying to view a Mapbox map in a Card Window. In a normal document window the code works fine - but in a card window it looks like the map tiles are failing to load. Below is the basic HTML to create a map.

 

I have this HTML stored in a text object off-screen and the WebViewer is set to this: "data: text/html;base64," & Base64Encode ( GetLayoutObjectAttribute ( "map_html" ; "content" ) ).

 

Any thoughts on why the WebViewer is behaving differently in a card window to a normal window? On a Mac, not tested on Windows. In FM16 obv. Pro and Advanced have same issue.

 

<!DOCTYPE html>
<html>
<head>
   <meta charset='utf-8' />
   <title>Display a map</title>
   <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
   <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.43.0/mapbox-gl.js'></script>
   <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.43.0/mapbox-gl.css' rel='stylesheet' />
   <style>
   body { margin:0; padding:0; }
   #map { position:absolute; top:0; bottom:0; width:100%; }
  
</style>
</head>
<body>

<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibmVpbHdqc2ltcHNvbiIsImEiOiJjamM5YWwyMjQwbXVqMnFvNGtwNmd5bHh6In0.xIL3015B77N3AwBQXpE1og';
var map = new mapboxgl.Map({
  container: 'map', // container id
  style: 'mapbox://styles/mapbox/streets-v9', // stylesheet location
  center: [-74.50, 40], // starting position [lng, lat]
  zoom: 9 // starting zoom
});
</script>

</body>
</html>

Outcomes