New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing projection crashes vuelayers #150
Comments
Hi @fasterlars , <template>
<vl-map data-projection="EPSG:21781">
<vl-view .../>
</vl-map>
</template>
<script>
// ... other imports
import {register} from 'ol/proj/proj4'
import proj4 from 'proj4'
// taken fron http://epsg.io/
proj4.defs('EPSG:21781',
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 ' +
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
'+towgs84=660.077,13.551,369.344,2.484,1.783,2.939,5.66 +units=m +no_defs')
register(proj4)
// now you can use projection by code EPSG:21781 in any component
export default {
// ...
}
</script> |
Additional examples
|
Thanks alot, it works now! That was very helpful, maybe it should be a part of the official guide? |
I totally agree, but currently haven't time for this. Thanks |
When I use the 3395 projection registered through "ol.proj.register" not for the map, but for the layer, an error appears Thank you! |
Hi @jonimnim , |
Tried like this: proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs') I think it would be better to have scope one for both the map and the layer. |
Which version of vuelayers do you use? |
0.11.21 |
It seems like you install |
Yes. But I need a new version of ol) |
Upgrade to ol v6 is on my roadmap, but for now vuelayers is based on v5.3.x. |
I will do so for now. Thanks) |
Hi, I have the same issue : My main.js :
My package.json :
Do you know why ? |
@JeremyGerard do you have this dir './node_modules/vuelayers/node_modules/...'? |
Hi,
|
Hmm ... So you now don't have this directory |
Yes |
I have made a simple app to focus on my issue :
Main.js :
I'm missing something.. |
I think you need to make |
The docs states that you can change projection with the dataProtection property: https://vuelayers.github.io/#/docs/quickstart?id=global-data-projection
But if I use other projections (for an example 25832 which I would prefer) than 4326 and 3857, vue crashes with the console error:
And after a while:
I am using the basic "Getting started" example. Any thoughts on this?
Thanks :)
The text was updated successfully, but these errors were encountered: