当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Drawing routes using Gmaps.js

问题描述:

I'm making a small demo app for myself and I use Gmaps.js library as a main tool to work with map and have a problem when I try to draw a route.

This code (from documentation) works excellent

 map.drawRoute({

origin: [-12.044012922866312, -77.02470665341184],

destination: [-12.090814532191756, -77.02271108990476],

travelMode: 'driving',

strokeColor: '#131540',

strokeOpacity: 0.6,

strokeWeight: 6

});

this one (mine) doesn't work

 map.drawRoute({

origin: [32.090814532191756, -85.090814532191756],

destination: [32.000814532191756, -85.090814532191756],

travelMode: 'driving',

strokeColor: '#131540',

strokeOpacity: 0.6,

strokeWeight: 6

});

Can you help me to find out the difference?

I will be thankful for advice about any other libraries to work with map.

网友答案:

The root cause was in the Google Maps API key.

分享给朋友:
您可能感兴趣的文章:
随机阅读: