ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
682 stars 230 forks source link

Format factory expects function, getting object #472

Closed scadergit closed 2 years ago

scadergit commented 2 years ago

Gone around on this one a bit...I'm using ol.format.TopoJSON, that returns an object, but format-factory expects a function. I feel like I'm doing something silly stupid, but don't see it.

      <vl-layer-vector-tile>
        <vl-source-vector-tile
          :format-factory="vectorFormatFactory"
          :url="vectorUrl"
        />
      </vl-layer-vector-tile>
    ...
    vectorFormatFactory () {
        return new ol.format.TopoJSON({})
    },

image

https://github.com/ghettovoice/vuelayers/blob/master/src/components/vector-tile-source/source.vue#L38

https://jsfiddle.net/ps9cg0jo/20/

Similar to this, but with valid data: https://github.com/ghettovoice/vuelayers/issues/426

scadergit commented 2 years ago

...and soon as I post that I figure out my stupid. I had it in computed, not methods.