Guest User

Untitled

a guest
Jul 20th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. // Import react-leaflet for the map / basemap components
  2. import { Map, TileLayer as Basemap } from 'react-leaflet';
  3.  
  4. // Import CARTO.js v4 <3
  5. import carto from 'carto.js';
  6.  
  7. // Import our custom Layer component (it uses carto.js methods internally)
  8. import Layer from './Layer';
  9.  
  10. // Voyager basemap <3
  11. const CARTO_BASEMAP = 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png';
  12.  
  13. constructor(props) {
  14. super(props);
  15.  
  16. this.state = {
  17. center: [40.758313915, -3.67774875],
  18. zoom: 11,
  19. },
  20.  
  21. // Setup the client in the contructor with our user and apiKey
  22. this.cartoClient = new carto.Client({ apiKey: 'wadus', username: 'rochoa' });
  23.  
  24. {
  25. "name": "client",
  26. "version": "0.1.0",
  27. "private": true,
  28. "dependencies": {
  29. "axios": "^0.18.0",
  30. "babel-polyfill": "^6.26.0",
  31. "carto.js": "^4.0.1",
  32. "classnames": "^2.2.6",
  33. "jsonwebtoken": "^8.3.0",
  34. "jwt-decode": "^2.2.0",
  35. "leaflet": "^1.3.3",
  36. "react": "^16.4.1",
  37. "react-dom": "^16.4.1",
  38. "react-leaflet": "^2.0.0",
  39. "react-redux": "^5.0.7",
  40. "react-router-dom": "^4.3.1",
  41. "react-scripts": "1.1.4",
  42. "react-simple-storage": "^1.2.1",
  43. "redux": "^4.0.0",
  44. "redux-connect": "^7.0.0",
  45. "redux-thunk": "^2.3.0"
  46. },
  47. "scripts": {
  48. "start": "react-scripts start",
  49. "build": "react-scripts build",
  50. "test": "react-scripts test --env=jsdom",
  51. "eject": "react-scripts eject"
  52. },
  53. "proxy": "http://localhost:5000"
  54. }
  55.  
  56. TypeError: __WEBPACK_IMPORTED_MODULE_2_carto_js___default.a.Client is not a constructor
Add Comment
Please, Sign In to add comment