route360 / r360-js

Route360° JavaScript API (now Targomo)
https://www.targomo.com/developers/
MIT License
174 stars 37 forks source link

Uncaught TypeError: r360.basemap is not a function #46

Closed ghost closed 6 years ago

ghost commented 6 years ago

I am getting error

Uncaught TypeError: r360.basemap is not a function

Any idea why?

Here is how I import it

 <script src="https://releases.route360.net/r360-js/latest.js"></script>
 <!-- Icons -->
 <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

and here is some code

let r360 = window.r360;
var travelMode = 'bike';
var latlon = [41.5259, 44.685];
console.log(r360) // does output an object

// initialise the base map
r360.basemap({ style: 'basic', apikey: 'MYSECRETKEY' }).addTo(map);

ps. this is react app.

pps. running npm install --s route360takes ages too (doesn't complete).

EDIT1: installing via npm seems to have fixed the issue.