I have a problem with my GetfeatureInfo I use this code:
map.on('singleclick', function(evt) { document.getElementById('info').innerHTML = ''; var viewResolution = /** @type {number} */ (view.getResolution()); var url = Rustica.getGetFeatureInfoUrl( evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'application/json'}); if (url) { document.getElementById('info').innerHTML = ''; } }); map.on('pointermove', function(evt) { if (evt.dragging) { return; } var pixel = map.getEventPixel(evt.originalEvent); var hit = map.forEachLayerAtPixel(pixel, function(layer) { return true; }); map.getTargetElement().style.cursor = hit ? 'pointer' : ''; });and i recive this information :
Thanks for all.
أكثر...
map.on('singleclick', function(evt) { document.getElementById('info').innerHTML = ''; var viewResolution = /** @type {number} */ (view.getResolution()); var url = Rustica.getGetFeatureInfoUrl( evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'application/json'}); if (url) { document.getElementById('info').innerHTML = ''; } }); map.on('pointermove', function(evt) { if (evt.dragging) { return; } var pixel = map.getEventPixel(evt.originalEvent); var hit = map.forEachLayerAtPixel(pixel, function(layer) { return true; }); map.getTargetElement().style.cursor = hit ? 'pointer' : ''; });and i recive this information :
{"type":"FeatureCollection","totalFeatures":"unknown","features":[{"type":"Feature","id":"rustica.22","geometry":{"type":"Polygon","coordinates":[[[-37155.372408933064,4804269.421434741],[-37085.144868682895,4804399.503897646],[-37046.8949331874,4804372.239200349],[-37111.13156967358,4804251.317020955],[-37155.372408933064,4804269.421434741]]]},"geometry_name":"the_geom","properties":{"PCAT1":"46166A0","PCAT2":"0500051","EJERCICIO":null,"NUM_EXP":null,"CONTROL":null,"MAPA":294,"DELEGACIO":46,"MUNICIPIO":166,"MASA":"005","HOJA":"A","PARCELA":"00051","SUBPARCE":"0","TIPO":"R","COORX":729052.43,"COORY":4383946.44,"NUMSYMBOL":8,"FECHAALTA":20120524,"FECHABAJA":99999999,"AREA":4042,"NINTERNO":2.10991406E8,"refcat":"46166A00500051"}}],"crs":{"type":"name","properties":{"name":"urn
gc:def:crs:EPSG::3857"}}}
NOW is my question, How I can get this information for use in a form?For the GetFeatureInfo i use the example for openlayers.org.
Thanks for all.
أكثر...