[OpenLayers-Users] Openlayer

yassine bouderaa bouderaa.yassine at gmail.com
Sun Nov 25 05:30:53 PST 2012


Thanks for your answer. in matter of fact I do the getfeatureinfo(wms
request) but I don't know how can'I extract the PK from it. here is a part
of my code which get the feature data .
map.events.register('click', map, function (e) {
  //alert(map.getExtent().toBBOX());
  x1=parseInt(e.xy.x);
  y1=parseInt(e.xy.y);
    var url = 'http://localhost:8181/geoserver/cite/wms'
      + "?REQUEST=GetFeatureInfo"
      + "&EXCEPTIONS=application/vnd.ogc.se_xml"
      + "&BBOX=" + map.getExtent().toBBOX()
      + "&X=" + x1
      + "&Y=" + y1
      + "&INFO_FORMAT=text/html"
      + "&QUERY_LAYERS=cite:test"
      + "&LAYERS=test"
      + "&FEATURE_COUNT=50"
      + "&SRS=EPSG:900913"
      + "&STYLES="
      + "&WIDTH=" + map.size.w
      + "&HEIGHT=" + map.size.h;
    window.open(url,
      "getfeatureinfo",
      "location=10,status=10,scrollbars=1,width=600,height=150"
    );
  });

but the probleme here is the data is displayed in a new window page !!!!
is there anything you can do for more help and thank you




2012/11/25 Stephen Woodbridge <woodbri at swoodbridge.com>

> I can add a little to Tue's comments.
>
> 1. you can look at installing tinyOWS which is part of mapserver.orgreleases, this implements WFS-T
>
> 2. alternative this is as Tue has suggested do a getfeatureinfo (WMS
> request) on the feature, and extract the PK. You can then trivially write
> an ajax request in say php, to that you send the PK to to and it connects
> to the postgresql/postgis database and deletes the feature.
>
> Both of these assume that the data layer you want to edit is being served
> from a postgresql/postgis database. You can NOT safely delete features from
> shapefiles.
>
> -Steve W
>
>
> On 11/24/2012 5:35 PM, Tue Topholm wrote:
>
>> You can't do that with openlayers, except with WFS-T
>>
>> You will need to develop it. (simple solution here)
>>
>> 1. use getfeatureinfo (WMS request) on the feature, and extract the PK.
>> 2. Delete the feature in the database with the PK you got above. (This
>> needs to be developed in some server side language)
>> 3. Refresh the wms, and it would be removed.
>>
>>
>> --
>>
>> Med venlig hilsen / Kind regards
>>
>> Tue Topholm
>> Sugee
>> Tlf: +45 32 13 32 32
>> W: http://www.sugee.dk
>>
>>
>> 2012/11/24 yassine bouderaa <bouderaa.yassine at gmail.com
>> <mailto:bouderaa.yassine@**gmail.com <bouderaa.yassine at gmail.com>>>
>>
>>
>>
>>     Hi.
>>
>>     I need to know how can I delete a feature from a wms layer loaded
>>     from a database postgres to geoserver and displayed using openlayer
>>     , I don’t want to delete a feature from a vector layer but from a wms
>> .
>>
>>     Thanks for ur help.
>>
>>
>>     ______________________________**_________________
>>     Users mailing list
>>     Users at lists.osgeo.org <mailto:Users at lists.osgeo.org>
>>     http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>>
>>
>>
>>
>>
>> ______________________________**_________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>>
>>
> ______________________________**_________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121125/17a84321/attachment.html>


More information about the Users mailing list