Closed Harrisonl closed 8 years ago
Hi @Harrisonl, can you send a link to a jsfiddle or to your project so that i can test it ? i can't reproduce it using the examples.
@alex3165 it's a company project so most likely not sorry. I can probably add in the webpack and package.json file though if that helps? I'll have to add them when I get home.
On a side, is there any other dependencies I need to get this working? I reduced the london example to pretty much the exact same lines of code and replicated the webpack file from the example and it works there. I can't figure out what the difference between the two is.
// package.json
{
"name": "...",
"version": "1.0.0",
"description": "...",
"main": "index.js",
"scripts": {
"start": "node server.js",
"test": "mocha --require babel-register --require .test-setup.js -R spec app/**/spec.js",
"cover": "nyc -x '**/*spec.js' -n 'app' -r text -r html -r lcov npm test"
},
"author": "Harrison Lucas",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.11.6",
"css-loader": "^0.23.1",
"enzyme": "^2.4.1",
"expect": "^1.20.2",
"extract-text-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^2.22.0",
"jsdom": "^9.4.2",
"mocha": "^3.0.2",
"nyc": "^8.1.0",
"postcss-cssnext": "^2.7.0",
"postcss-loader": "^0.10.0",
"react-addons-test-utils": "^15.3.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
},
"babel": {
"presets": [
"es2015",
"react",
"stage-0"
]
},
"dependencies": {
"halogen": "^0.2.0",
"history": "^3.0.0",
"lodash.assign": "^4.2.0",
"react": "^15.3.0",
"react-css-modules": "^3.7.10",
"react-dom": "^15.3.0",
"react-mapbox-gl": "^0.9.2",
"react-redux": "^4.4.5",
"react-router": "^2.6.1",
"react-router-redux": "^4.0.5",
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
"whatwg-fetch": "^1.0.0"
}
}
// webpack
var path = require('path')
var webpack = require('webpack')
var cssnext = require('postcss-cssnext')
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'./app/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new webpack.DefinePlugin({
DEV: true
})
],
module: {
loaders: [
// JS Loaders
{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/,
include: path.join(__dirname, 'app')
},
// CSS Loaders
{
test: /\.css$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[local]_[hash:base64:5]!postcss',
include: path.join(__dirname, 'app')
}
]
},
resolve: {
extensions: [ '', '.js' ]
},
postcss: function () {
return [cssnext]
}
}
Hi @Harrisonl ! Try to set pitch={0} in your map's definition. It helps me :)
That is surprising because the pitch props already have 0
as a default, but if it solve the issue, it can be a temporary work around.
@alex3165 I'm sorry but version (0.9.2) from npm doesn't have default pitch value.
Ups i will push a new version thanks 👍
Should be fixed with the version 0.9.3 :)
oh right. thanks @alex3165 & @lkazberova - I'll have a look when I get home tonight.
Worked perfectly. Thanks guys.
No matter what I do, I can not get the map to actually render. The box itself renders, but is empty and this error
mapbox-gl.js?31ef:295 Uncaught TypeError: Cannot read property '0' of undefined
appears every time i move my mouse around where the map should be. The cursor changes, so the map box is there, just empty. Below is the component that renders it: