You'll have to compute an extent for that particular feature. Likely
requires a call to the service. I don't know the OpenLayers specifics off
hand but should be easy to find online.
Jason Newmoyer
Newmoyer Geospatial Solutions
843.606.0424
[email protected]
On Mon, Oct 9, 2017 at 5:15 AM, annalisa <[email protected]> wrote:
> Hi guy!
> I'm using geoserver and in my map, clicking on a button, I filter the
> markers basing on state name.
> The problem is that the zoom is always the same, meanwhile i want to zoom
> and center the map based on my filters.
> I can i do?
>
> Here my code to filter data
>
> var filterParams = {
> 'FILTER': null,
> 'CQL_FILTER': null,
> 'FEATUREID': null
> };
> if (filterType == "cql") {
> filterParams["CQL_FILTER"] = "states_code='IT'";
> }
>
>
>
>
> map.getLayers().forEach(function (lyr) {
>
> lyr.getSource().updateParams(filterParams);
> });
>
>
> and the script formy map is here
>
>
> var map = new ol.Map({
> controls: ol.control.defaults({
> attribution: false
> }).extend([mousePositionControl]),
> layers: [base ],
> overlays: [overlay],
> target: 'map',
> view: new ol.View({
> projection: projection
> })
> });
>
> // map.addLayer(gruppo);
> map.addLayer(untiled);
>
> i filter my markers based on my ol.source.ImageWMS.
>
>
> thanks
>
>
>
> -----
> annalisa
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-
> f3786390.html
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines: http://geoserver.org/comm/
> userlist-guidelines.html
>
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users