OpenLayers using Diamond

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
sressi
Posts: 4
Joined: 23 Jun 2015, 19:06

11 Feb 2022, 14:44

Hi guys. I'm trying to include OpenLayers using Diamond and I can't even visualize the simplest map. I tryed building a vu3 primevue project from scracth and it worked fine. The thing is that when I try to include a map in the project I'm developing that is already using Diamond it does not work.

I have installed openlayers

Code: Select all

npm install vue3-openlayers
Added the following lines to main.js:

Code: Select all

import OpenLayersMap from 'vue3-openlayers'
import 'vue3-openlayers/dist/vue3-openlayers.css'
...
app.use(OpenLayersMap)
Then created a test page:

Code: Select all

<template>
<ol-map :loadTilesWhileAnimating="true" :loadTilesWhileInteracting="true" style="height:400px">

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

    <ol-tile-layer>
        <ol-source-osm />
    </ol-tile-layer>
    
</ol-map>
</template>

<script>
import {defineComponent,ref} from "vue";

export default defineComponent({
      setup() {
        const center = ref([40, 40])
        const projection = ref('EPSG:4326')
        const zoom = ref(8)
        const rotation = ref(0)
        return {
            center,
            projection,
            zoom,
            rotation
        }
    },
})
</script>
After running

Code: Select all

npm run serve
the map is not visible and theres an error on Chrome's console:
TypeError: Object(...) is not a function
at Proxy.Mapvue_type_template_id_39e43851_lang_true_render (vue3-openlayers.common.js?2993:12709:1)...

I'm new to vue, I've been trying to figure it out for a few days and couldn't fix it. Any help would be greatly appreciated.

sressi
Posts: 4
Joined: 23 Jun 2015, 19:06

22 Feb 2022, 13:18

Hi guys! No answer at all? I really need to solve this and be able to use OpenLayers within Diamond. Thanks!

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

01 Mar 2022, 13:07

Hi,

I really don't know anything about OpenLayers but how do you import PrimeVue? Did you check PrimeVue setup page?

sressi
Posts: 4
Joined: 23 Jun 2015, 19:06

03 Mar 2022, 15:19

Project is running using primevue and diamond template. Everything works fine. I need to add some map functionality and that's why I need to use openlayers. If I build a primevue project from scratch (no diamond template) openlayers work and a map is shown, but when I try to use openlayers in my project (with diamond) it does not work.

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

04 Mar 2022, 12:41

What kind of error are you getting on the console? Could you attach some screenshots?

Post Reply

Return to “Diamond - PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests