Skip to content

Provide a way to register a custom Projection ol.proj.proj4 #58

Answered by MelihAltintas
eltorio asked this question in Q&A
Discussion options

You must be logged in to vote

thanks for your suggestion.

I added a new component for registration. You can easily register the new project with:

    <ol-projection-register projectionName="EPSG:21781"
    :projectionExtent="[-357823.2365, 6037008.6939, 1313632.3628, 7230727.3772]"
    projectionDef="+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"/>

then you can use like that:

<ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom" projection="EPSG:21781" />

please update your version to V.0.1.56

example: https://codesandbox.io/s/projection-register-example-kl0qs?file=/src/App.vue

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MelihAltintas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants
Converted from issue

This discussion was converted from issue #57 on January 21, 2022 08:10.