-
Notifications
You must be signed in to change notification settings - Fork 229
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
Add support of GetFeatureInfo request #6
Comments
+ add getFeatureInfoUrl method - returns WMS GetFeatureInfo Request URL + add watchers on props
Hi, Do you have erase this functionnality with the commit : 0b958e2 ? |
Hi, |
Oh yes you right ! |
But i have an error... Module parse failed: Unexpected token (14:20) I m beginner in vuejs. Do you know what's my issue ? |
Are you import components from vuelayers |
i do that : <script> import getFeatureInfoUrl from '../../node_modules/vuelayers/src/mixin/wms-source.js' export default { |
and in my main.js : |
You need only this
Method getFeetureInfoUrl is part of Anyway if you want use mixins, or helpers from vuelayers, you should import them from |
In vuelayers v0.10.x under lib all components compiled for CommonJs environment. If you are using webpack so you can use ES modules import/export that under lib/_esm folder. In the next v0.11 version commonjs support will be dropped, all compiled code will be under lib folder |
Thanks for your support. |
I think that because i have this error : |
I wrote not quite well about src folder. You can use any module from here but cause there is a source code you should compile it yourself. lib folder contains ready to use compiled modules. |
wms-source.js default export is a plain object.
|
Right. I must add resolution and projection |
Because wmsSource is an mixin, it should be used to build a vue component. This component inherits all methods from wmsSource. Mixin object isn't for direct usage. What are you trying to make? Is it a custom wms source? |
i have a map with wms data. I try to catch my wms source tile informations |
Yes it is |
thanks for your help. |
Are you render wms layers with vl-source-wns component? If so all you need is add ref attribute for each vl-source-wms tags, then use getFeatureInfoUrl method of the component instance. <template>
<vl-map @click="mapClicked">
<vl-layer-tile>
<vl-source-wms ref="mySource" ...></vl-source-wms>
</vl-layer-tile>
</vl-map>
</template>
<script>
export default {
...
methods: {
mapClicked (evt) {
console.log(this.$refs.mySource.getFeatureInfoUrl(evt.coordinate))
},
}
}
</script> |
I'm writting from phone, so sorry if there is some errors in example |
My code :
|
Cannot read property 'mySource' of undefined |
I have try : <vl-source-wms v-bind:ref="mySource" |
I don't have acces to : |
Show me <script> section please |
|
Hmm. Very strange, this.$refs shouldn't be undefined, it's Vue feature. Probably some kind of syntax error or typo. Currently I can't see where is the problem, I need to deploy test app with your code to reproduce it. |
I will work on it too. |
The reference seems to work weel. |
This error come from : wms-source.js |
I found that there was a typo in the method name, it should be |
Great !
|
Show me |
Some params are missing (like info_format)but i have my request ! |
Nice!
which params? |
"info_format" for now the 4th params of getgetfeatureinfoUrl |
I add it like that : It s perfect ! |
You should provide it trough 4th method argument or with |
Thanks for your singleness |
Add methods to send request GetFeatureInfo in WMS source
The text was updated successfully, but these errors were encountered: