Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法在Tizen可穿戴web应用程序中显示OpenStreepMap_Javascript_Openlayers_Openstreetmap_Tizen_Tizen Web App - Fatal编程技术网

Javascript 无法在Tizen可穿戴web应用程序中显示OpenStreepMap

Javascript 无法在Tizen可穿戴web应用程序中显示OpenStreepMap,javascript,openlayers,openstreetmap,tizen,tizen-web-app,Javascript,Openlayers,Openstreetmap,Tizen,Tizen Web App,我正在尝试使用Tizen在可穿戴模拟器上使用OpenLayers打开OpenStreetMap HTML <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width,user-scalable=no"> <title>Circular UI</title> <link rel="stylesheet"

我正在尝试使用Tizen在可穿戴模拟器上使用OpenLayers打开OpenStreetMap

HTML

<!DOCTYPE html>
<html>
<head>
   <meta name="viewport" content="width=device-width,user-scalable=no">
   <title>Circular UI</title>
   <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
   <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" 
href="lib/tau/wearable/theme/default/tau.circle.min.css">
   <!-- load theme file for your application -->
   <link rel="stylesheet" href="css/style.css">
  </head>
<body>
<div class="ui-page ui-page-active" id="main">
  <header class="ui-header">
    <h2 class="ui-title">TAU Basic</h2>
  </header>
  <div class="ui-content content-padding">
    <p>test </p>
    <div id="map"></div>
  </div>
</div>
  <script src="ol.js"></script>
  <script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
  <script src="jquery-3.2.1.min.js"></script>
  <script src="app.js"></script>
  <script src="lowBatteryCheck.js"></script>
</body>
</html>
config.xml

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" 
xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/OSMOL" 
version="1.0.0" viewmodes="maximized">
  <access origin="*" subdomains="true"/>
  <access origin="http://openlayers.org/" subdomains="true"/>
  <access origin="https://openstreetmap.org/" subdomains="true"/>
  <content src="index.html"/>
  <feature name="http://tizen.org/feature/screen.size.normal"/>
  <icon src="icon.png"/>
  <name>OSMOL</name>
  <tizen:privilege name="http://tizen.org/privilege/internet"/>
  <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
  <tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
  <tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
  <feature name="http://tizen.org/feature/location.gps"/>
  <tizen:privilege name="http://tizen.org/privilege/location"/>
  <tizen:profile name="wearable"/>
  <tizen:setting hwkey-event="enable"/>
</widget>

net::ERR_NAME_RESOLUTION_失败c.tile.openstreetmap.org/2/2/2.png:1
得到
net::ERR_NAME_RESOLUTION_FAILED b.tile.openstreetmap.org/2/1/2.png:1
得到
2个以上相同的,不能发布应有的声誉

我认为这是access的config.xml中的一个问题。我尝试了很多方法,包括将这些链接添加到
。什么都不管用,我完全被卡住了


任何帮助或提示都将不胜感激

在emulator上运行它怎么样?我怀疑连接问题

当我开始将一个移动应用程序移植到wearable时,我认为它在没有黑魔法的情况下工作:


我发现,Tizen似乎以某种方式阻止了正常的OL CDN,请使用此

<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.1.1/ol.js"</script>

在Jquery之后但在app.js之前添加ol.js
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.1.1/ol.js"</script>