Comments (12)
Can you show me code of TpMap
component? Then I'll try to reproduce the issue
from vuelayers.
I'am sorry
Styles of component work fine
I forgot include main.css with rails helper stylesheet_pack_tag
<%= javascript_pack_tag 'main', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_pack_tag 'main', 'data-turbolinks-track': 'reload' %>
from vuelayers.
Ok, that's fine.
Take a note that recommended way to switch Vue build version is define alias through webpack config:
module.exports = {
...
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
},
},
...
}
Then all code that imports Vue will use the same build version.
from vuelayers.
Hi,
I thought i will write here as i am getting the same error instead of starting a new issue.
I am getting the same error.
All i added is the following
appEntry.js
import VueLayers from 'vuelayers'
import 'vuelayers/lib/style.css'
Vue.use(VueLayers);
Component.js
Add the following three properties in data() {return...}
center: [0, 0],
zoom: 3,
rotation: 0,
Componment.pug
vl-map(:load-tiles-while-animating='true', :load-tiles-while-interacting='true', style='height: 400px')
vl-view(:center.sync='center', :zoom.sync='zoom', :rotation.sync='rotation')
vl-layer-tile
vl-source-osm
am i missing anything?
from vuelayers.
Hi, @zakst ! Your code looks right. Are you building rails app with webpacker?
And can you show me your webpack config? Or may be you have test repository that reproduce the issue
from vuelayers.
Hello @ghettovoice
I am building a nodejs
app and below is the webpack.config.js
I also tried adding the following in the webpack.config.js
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
},
},
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const nodeEnv = process.env.NODE_ENV || 'development';
const isProduction = nodeEnv === 'production';
const LiveReloadPlugin = require('webpack-livereload-plugin');
module.exports = {
context: path.resolve(__dirname, './src'),
watch: true,
entry: {
app: './app.js',
bsjs: './mdb/js/bootstrap.js',
vendor: './mdb/sass/mdb.scss',
bootstrap: './mdb/css/bootstrap.css',
mdb: './mdb/css/mdb.css'
},
output: {
path: path.resolve(__dirname, './public/assets'),
filename: '[name].bundle.js',
publicPath: '/assets/',
},
devServer: {
contentBase: path.resolve(__dirname, './src'),
historyApiFallback: true,
port: 3000,
compress: isProduction,
inline: !isProduction,
hot: !isProduction,
host: '0.0.0.0',
stats: {
assets: true,
children: false,
chunks: false,
hash: false,
modules: false,
publicPath: false,
timings: true,
version: false,
warnings: true,
colors: {
green: '\u001b[32m',
},
},
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin({
filename: '[name].bundle.css',
allChunks: true,
}),
],
module: {
rules: [
{
test: /\.js$/,
exclude: [/node_modules/],
use: [{
loader: 'babel-loader',
options: {presets: ['es2015']},
}],
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: [{
loader: 'css-loader',
options: {importLoaders: 1},
}],
}),
},
{
test: /\.scss/i,
use: ExtractTextPlugin.extract([ 'css-loader', 'sass-loader' ])
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: 'url-loader?limit=20480&name=assets/[name]-[hash].[ext]',
},
{
test: /\.vue$/,
use:[{
loader: 'vue-loader',
options: {
loaders: {
js: 'babel-loader'
}
}
}]
},
]
}
};
from vuelayers.
Hmm, config looks good. Can you make test repo with your project setup, so I can deploy it locally?
from vuelayers.
That will be great!, will do so once back to my machine.
Am i supposed to include openlayers
? I see it part of the vuelayers
dependencies
but just making sure that will not be the issue?
from vuelayers.
Yes, vuelayers depends on openlayers, it should be loaded by webpack automatically.
Ok, post link here when you will be ready
from vuelayers.
I thought of trying something out and it got rid of all the errors although the map is just not loading.
Attached is the errors that USED TO
exist when i had import
in my app.js
once i changed it to require
, the errors disappeared.
I am going to try a couple of things before creating the repo.
Problem is there is no map at all.
from vuelayers.
I kept the code as is with the import
as shared when i started the conversation and just deleted the node_modules
and npm i
and all worked fine. Have no idea where the problem was but all is good now.
Thanks @ghettovoice
from vuelayers.
That's good! Seems like broken npm cache or inconsistent packages versions.
from vuelayers.
Related Issues (20)
- Vuequery missing peer HOT 1
- Label Vector Fonts don't' have the right rendering [BUG] HOT 4
- Access feature in drawFinsihCondition? HOT 2
- When using vl-geom-line-string or vl-geom-multi-line-string the map tiles arent loaded correcty anymore. HOT 2
- Web browser freezes when trying to view the demo HOT 1
- Dependency conflict installing vuelayers with NPM HOT 2
- unmount maps HOT 2
- Demos not working in Webpack install HOT 6
- Add a scale bar?
- tilePrefix not added when working with GWC HOT 2
- style-box gone in v0.12 HOT 2
- TileJSON source HOT 2
- m
- Using filters for tile layers HOT 1
- Support for Openlayers 7 HOT 4
- error occurs when activating the tab which contains vuelayers HOT 1
- Change to tileSize in 0.12 HOT 4
- forEachFeatureAtPixel layerFilter not excute in right way HOT 3
- Validate draw
- vl-style-text problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuelayers.