Developers Knowledge Base

Learn how to manipulate, modify, and tune your GeoMedia WebMap, Geospatial Portal and Consumer portal instances.
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,595 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

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";

$"after zoom");
featureClassId: "{}OM_USA_STATES",
url: "",
definitionName: "WFS",
queryName: queryName,
addToLegend: false,
filters: [{
operator: "OR",
operands: [{
operator: "=",
operands: ["{}STATE_NAME", "Oklahoma"]
}, {
operator: "=",
operands: ["{}STATE_NAME", "Arkansas"]
}, {
operator: "=",
operands: ["{}STATE_NAME", "Alabama"]
function(result) {
analysisId: result.analysisId,
}, function(result2) {
result2.analysis.getData(function(getDataResult) {