2017-05-16 1 views
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 
    ); 

答えて

2

と方法を見つけることができません。エンコーディングは、<script>http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=encodingでオプトインする必要があるオプションのjsライブラリです。

the example with encoding libraryを参照してください。

+0

この例とは逆のプロセスです。コード化された文字列を使用して、 – Draka

+0

yesの配列にします。他の方法を使用するだけです。私は例を挙げて、物事を設定する方法を示しました。 –

+0

ありがとう、私は答えを含む質問を編集した – Draka

関連する問題