私はポリマー材料のgoogle-map-directions
のlatlng
を使用するtriyngです。私がちょうどAustin
のような文字列を入れれば、それは動作し、方向があります。しかし、私がnew google.maps.LatLng(29.520332, -98.431211)
を試しても、方向はありません。明確にするために、エラーエーテルはありません。ポリマーgoogle-map-directions - 最終アドレスにlatlngを使用
テンプレートでは、{{endingAddress}}
を出力しました。文字列(...., ....)
が正常に出力されたので、データバインディングは正しく機能しています。
提案がありますか?
<div id="map-container">
<google-map latitude="29.520332" longitude="-98.431211"
api-key='AIzaXjfkwM'
fit-to-markers>
<google-map-marker latitude="29.520332" longitude="-98.431211"
title="wedding location"></google-map-marker>
</google-map>
<google-map-directions
api-key='AICpwM'
start-address="Austin"
end-address$="{{endingAddress}}"></google-map-directions>
</div>
</div>
</template>
<script>
Polymer({
is: 'map-wedding',
properties: {
endingAddress: {
type: Object
}
},
attached: function() {
var gMap = document.querySelector('google-map');
gMap.addEventListener('api-load', function(e) {
document.querySelector('google-map-directions').map = this.map;
this.endingAddress = new google.maps.LatLng(29.520332, -98.431211);
}.bind(this));
}
})