Marudi Abhinaya
Marudi Abhinaya

Reputation: 21

Unable to get the Correct URL from the getFeatureInfoUrl method in OpenLayers 7 using Angular

I want to get the Information of the Layer and display it to the user. Here I used getFeatureInfoUrl method of OpenLayers 7 to get the URL but I am getting the BBOX,I and J values as NaN I have to get the URL like this : http://Localhost:8085/geoserver/wms?service=wms&layers=mysource:mylayer&srs=EPSG:32643&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=mysource:mylayer&tiled=false&INFO_FORMAT=application%2Fjson&I=50&J=50&CRS=EPSG%3A3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=8530761.341300901%2C1914412.2493969216%2C8531725.278495006%2C1915376.1865910282

http://localhost:8085/geoserver/wms?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=mysource%3Amylayer&LAYERS=mysource%3Amylayer&SRS=EPSG%3A3857&INFO_FORMAT=application%2Fjson&FEATURE_COUNT=250&X=NaN&Y=NaN&STYLES=&WIDTH=101&HEIGHT=101&BBOX=NaN%2CNaN%2CNaN%2CNaN

but I am getting the URL :

Here is my code :

      const url = source!.getFeatureInfoUrl(
      evt.coordinate,
      evt.target.get('resolution'),
      view.getProjection(),
      {
        'INFO_FORMAT': 'application/json',
        'FEATURE_COUNT': 250,
        'QUERY_LAYERS': 'Mysource:Mylayer',
      }
    );

Any ideas of how to get the correct URL ??

Upvotes: 0

Views: 65

Answers (0)

Related Questions