在桌面网络浏览器中绘制折线时,它将正确显示但是当在javaFX Webview中绘制时,它看起来像这样两种方法=(本地桌面和JFX webview)都使用相同的HTML,不知道出了什么问题,在基于chrome的JxBroswer中,它很好用,但是它是有偿的,很难更改[]
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polylines</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// This example creates a 2-pixel-wide red polyline showing the path of
// the first trans-Pacific flight between Oakland, CA, and Brisbane,
// Australia which was made by Charles Kingsford Smith.
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: {lat: 0, lng: -180},
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var flightPlanCoordinates = [
{lat: 37.772, lng: -122.214},
{lat: 21.291, lng: -157.821},
{lat: -18.142, lng: 178.431},
{lat: -27.467, lng: 153.027}
];
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
geodesic: false,
strokeColor: '#ff272f',
strokeOpacity: 1,
strokeWeight: 1
});
flightPath.setMap(map);
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap">
</script>
</body>
</html>
[在桌面Web浏览器中绘制折线时,它可以正确渲染,但是在javaFX Webview中绘制时,它看起来像这样。两种方法=(本机桌面和JFX Webview都使用...