Hexagon Geospatial

Developers Knowledge Base

WebGIS enables powerful geospatial web applications and services that securely share your organization’s rich geospatial data, and provides tools to deeply examine spatial data and create value added products, on demand.
Showing results for 
Search instead for 
Do you mean 

FitLayer To Analysis

by Technical Evangelist on ‎09-09-2015 04:09 AM - edited on ‎02-07-2018 06:43 AM by Technical Evangelist (1,231 Views)


This example uses GJUtils library

Portal "fitLayer" on analyses zooms by default to the whole layer and not just to the resulting objects. What we need in some cases is to fit the query results to the bbox of the results and not the whole layer.


Code sample

by jkratcha
on ‎12-26-2017 01:44 PM

I went to this page


and tried the example, but it did not zoom to the query.  It is still fitting the entire continental USA map.

Is there a way to zoom to the queryset rather than the whole feature?




example I retrieved is listed below:


var queryName = "Sample query";

$GP.ui.info("after zoom");
featureClassId: "{http://www.intergraph.com/geomedia/gml}OM_USA_STATES",
url: "http://demo.hexagongeospatial.com/GWM_WFS_NonTransactional/service.svc/get",
definitionName: "WFS",
queryName: queryName,
addToLegend: false,
filters: [{
operator: "OR",
operands: [{
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Oklahoma"]
}, {
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Arkansas"]
}, {
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Alabama"]
function(result) {
analysisId: result.analysisId,
}, function(result2) {
result2.analysis.getData(function(getDataResult) {