0
この関数を使用して文字列をデコードするにはどうすればよいですか?dartlangでgoogle.maps.geometry.encoding.decodePathを使用するにはどうすればよいですか?
私はネイティブライブラリあなたがpackage:google_maps/google_maps_encoding.dart
をインポートしてencoding.decodePath(path)
を使用することができますgoogle_maps
パッケージに
var path = google.maps.geometry.encoding.decodePath(encodedStr);
----- Soluction ----
String str = "ern[[email protected]\[email protected]@kAPY`[email protected]@^HOzAaClCgElBsCfBhA";
var decodedPath = encoding.decodePath(str);
var estimate_line = new Polyline(new PolylineOptions()
..path = decodedPath
..geodesic = true
..strokeColor = '#FF0000'
..strokeOpacity = 1.0
..strokeWeight = 2
..map = map
);
この例とは逆のプロセスです。コード化された文字列を使用して、 – Draka
yesの配列にします。他の方法を使用するだけです。私は例を挙げて、物事を設定する方法を示しました。 –
ありがとう、私は答えを含む質問を編集した – Draka