0

The rotate function in map map is bugged (alt ctrl + click) and I can't figure out why :

It seems like the roration point is wrong, and it kind of zoom in/ zoom out on mouse move. Also, the map does update when it move

Here is a preview of what is does : STEP 1 : unrotated map enter image description here

STEP 2 : rotate map with alt ctrl enter image description here

As uyou can see, the center of the picture 1 is not the center of the picture 2 anymore. Plus, you can easily see it has dezoomed. I can' understand why it does this, I have many OL stuff on my map : selection, bitmaplayer, overlay but here is the main code for map

 mounted () {
    this.ol = this.createMap()
    this.isReady = true
    this.redraw()

    if (this.isSelectionEnable) {
      this.enableSelection(
        this.ol,
        this.selectInteraction,
        this.selectedIconStyle,
        this.vectorSource
      )
      this.enableOverlayOnSelection()
    }
  },

// later, in methods

createMap () {
      return new Map({
        target: 'map',
        layers: [],
        view: this.createView(),
        controls: [],
        pixelRatio: 1,
        interactions: defaults({ doubleClickZoom: false })
      })
    },
    createOSMLayer (title = 'OSM', zIndex = 100) {
      return new TileLayer({
        title,
        zIndex,
        source: new OSMSource()
      })
    },
    createView () {
      return new View({
        center:
        transform(
          [this.longitude, this.latitude],
          'EPSG:4326',
          'EPSG:3857'
        ),
        zoom: 20
      })
    },

I tried to comment piece of code but it doesnt change anything.

  transform(
              [this.longitude, this.latitude],
              'EPSG:4326',
              'EPSG:3857'
            ),

I suspect the transform or ESPG 4326 to ESPG 3857 to cause this but I dont understand ho how to fix. If you guys have any suggestions...!

EDIT : enter image description here seems like the canvas rotate but in a wierd way ..

Jérome BORGA
  • 555
  • 1
  • 3
  • 12

0 Answers0