Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.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
使用JavaWebView的GoogleMapsAPI中的奇怪字符_Java_Html_Google Maps - Fatal编程技术网

使用JavaWebView的GoogleMapsAPI中的奇怪字符

使用JavaWebView的GoogleMapsAPI中的奇怪字符,java,html,google-maps,Java,Html,Google Maps,编辑: 我想我发现了问题,我用Java7在一个窗口中测试应用程序,运行良好,没有奇怪的符号,用Java8在两个不同的Mac上运行应用程序,但失败了。我不相信这个版本,因为java应该在任何平台上运行,就像在任何理论上一样 RE:编辑: 是操作系统!!!!!我刚刚检查了一下,在一个使用Java8的Windows中,我能做些什么((我使用macOS) 也许只是JavaFX版本,可以在应用程序中保存JavaFX的旧版本,但不知道如何做,请提供帮助 结束编辑 我在JavaFX中使用WebView制作了一

编辑: 我想我发现了问题,我用Java7在一个窗口中测试应用程序,运行良好,没有奇怪的符号,用Java8在两个不同的Mac上运行应用程序,但失败了。我不相信这个版本,因为java应该在任何平台上运行,就像在任何理论上一样

RE:编辑: 是操作系统!!!!!我刚刚检查了一下,在一个使用Java8的Windows中,我能做些什么((我使用macOS)

也许只是JavaFX版本,可以在应用程序中保存JavaFX的旧版本,但不知道如何做,请提供帮助

结束编辑

我在JavaFX中使用WebView制作了一个桌面java应用程序,制作了我自己的HTML页面,一切都很好,但是突然字符失败了,我不认为是HTML,因为我放了H1,看起来很好,但谷歌地图没有

HTML在浏览器中工作正常,但在java!中失败

还有,我擦去饼干

这是一个截图

以下是来自google api的HTML most复制粘贴:

<!DOCTYPE html>
  <html>
  <head>
  <meta >
    <title> "Vista de Clientes" </title>

    <style> 
    #map {
        height: 100%;
    }
    html, body {
  font-family: sans-serif;
        height: 100%;
        margin: 0;
        padding: 0;
    }

  .controls {
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: 2px 0 0 2px;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  height: 32px;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  #pac-input {
  background-color: #fff;
  font-family: Roboto;
  font-size: 15px;
  font-weight: 300;
  margin-left: 12px;
  padding: 0 11px 0 13px;
  text-overflow: ellipsis;
  width: 300px;
  }

  #pac-input:focus {
  border-color: #4d90fe;
  }

  .pac-container {
  font-family: Roboto;
  }

  #type-selector {
  color: #fff;
  background-color: #4d90fe;
  padding: 5px 11px 0px 11px;
  }

  #type-selector label {
  font-family: Roboto;
  font-size: 13px;
  font-weight: 300;
  }
  #target {
  width: 345px;
  }
    </style>
  </head>
  <body>

  <input id="pac-input" class="controls" type="text" placeholder="Search Box">
  <h1> hola </h1>
    <div id="map"></div>

    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=APIKEYISGOOD&libraries=places"></script>

  <script>



  // object for the stores
  var GreenCircle = {
  path: google.maps.SymbolPath.CIRCLE,
  fillColor: 'Lime',
  fillOpacity: 1,
  scale: 10,
  strokeColor: 'green',
  strokeWeight: 1
  }; 

  // google map instance
  var map;
  var markers = [];

  // function for the initialization
  function initMap() {
  map = new google.maps.Map(document.getElementById('map'), {
  zoom: 12,
  center: {lat: 21.8857199, lng: -102.3613399}
  });

  var input = document.getElementById('pac-input');
  var searchBox = new google.maps.places.SearchBox(input);
  map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);

  // Bias the SearchBox results towards current map's viewport.
  map.addListener('bounds_changed', function() {
  searchBox.setBounds(map.getBounds());
  });


  searchBox.addListener('places_changed', function() {
  var places = searchBox.getPlaces();

  if (places.length == 0) {
  return;
  }


  // Clear out the old markers.
  markers.forEach(function(marker) {
  marker.setMap(null);
  });
  markers = [];

  // For each place, get the icon, name and location.
  var bounds = new google.maps.LatLngBounds();
  places.forEach(function(place) {
  if (!place.geometry) {
  console.log("Returned place contains no geometry");
  return;
  }

  var icon = {
  url: place.icon,
  size: new google.maps.Size(71, 71),
  origin: new google.maps.Point(0, 0),
  anchor: new google.maps.Point(17, 34),
  scaledSize: new google.maps.Size(25, 25)
  };

  // Create a marker for each place.
  markers.push(new google.maps.Marker({
  map: map,
  icon: icon,
  title: place.name,
  position: place.geometry.location,
  draggable: true
  }));

  if (place.geometry.viewport) {
  // Only geocodes have viewport.
  bounds.union(place.geometry.viewport);
  } else {
  bounds.extend(place.geometry.location);
  }
  });
  map.fitBounds(bounds);
  }); 
  }

    initMap();

    function setMarker(latvar, lngvar, labels){
  var marker = new google.maps.Marker({ 
  position: { lat: latvar, lng: lngvar},
  map: map,
  label: labels || "",
  tittle: labels,
  icon: GreenCircle
  });
    }

  function setSelfMarker(Geojson)
  {
  map.data.addGeoJson( JSON.parse(Geojson) );
  }

  function setPosition(lat, lng)
  {
  map.setCenter(new google.maps.LatLng( lat, lng ) );
  }

    </script>


  </body>
  </html>

是一个包含完整html的字符串。

这里的问题是Mac上的JavaFX webview中有一个错误。它试图在本地加载一些字体,但被禁止。您可以通过将以下CSS指令添加到您的
标记来解决Google maps的这一问题

.gm-style-mtc > div, .gm-style > div, .gm-style-cc > div, .gm-style {font-family:sans-serif !important;}

这里的问题是Mac上的JavaFX webview中有一个bug。它试图在本地加载一些字体,但被禁止。您可以通过在
标记中添加以下CSS指令来解决Google maps的这一问题

.gm-style-mtc > div, .gm-style > div, .gm-style-cc > div, .gm-style {font-family:sans-serif !important;}

你有没有找到解决方案?我有同样的问题你有没有找到解决方案?我有同样的问题这个错误已经报告给Oracle了吗?我有同样的问题,我希望它得到修复,而不是到处乱动。我已经将这个错误提交给Oracle。看起来不像以前提交过。可以吗d请在此处提供JIRA bug id,以便我可以跟踪该bug?这是bug报告是否有可能将其后端口到8?是否已将该bug报告给Oracle?我有相同的问题,我希望该问题得到修复,而不是自行解决。我已将该bug提交给Oracle。看起来它不是以前的我已经提交了。你能不能在这里提供JIRA bug id,这样我就可以跟踪bug了?这是bug报告,有没有可能这会被后传到8?