我想从数据库加载折线路径。我在变量中使用一个编码折线尝试了它,但它没有显示折线。这是我的代码段:
var polylayer = ['munoEub_uSEGDFMKLJYSXRa@Y`@Xq@e@p@d@w@i@v@h@eAu@']
addEncodedPaths( encodedFlightPaths );
function addEncodedPaths( encodedPaths ) {
for( var i = 0, n = encodedPaths.length; i < n; i++ ) {
addEncodedPath( encodedPaths[i] );
}
}
function addEncodedPath( encodedPath ) {
var path = google.maps.geometry.encoding.decodePath( encodedPath );
var polyline = new google.maps.Polyline({
path: path,
strokeColor: "#0000FF",
strokeOpacity: 1.0,
strokeWeight: 2
});
polyline.setMap( map );
}
&#13;