Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 248
Registered: ‎05-01-2016

URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

I have tool tips configured that display when hovering over parcels on my SDK webmap project.  When i add a parcel query to the legend the tool tips no longer display.  I have tried programmatically (islocateable: false) and by right mouse click  (uncheck locatable) to make the query non-locatable so the parcel tool tips will still display but have not been successful.  How can i make the parcel tool tips display when hovering over parcel when i have a parcel query added to the legend?   The PARCELS are a WMPS feature.

Thanks!

Technical Evangelist
Posts: 132
Registered: ‎08-05-2015

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

What map layers are present? Is the parcel query layer on top of everything?

Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

[ Edited ]

There are many layers including  parcels and imagery but before i add the parcel query the tool tips display fine.  After I add the parcel query, the parcels in the query do not display their tooltops.  I've tried moving the query in the legend up and down (from bottom to top) and making it unlocatable using the legend interface (ie not with code) and still am not able to get the tool tips (information about the parcel) to display when i hover over a parcel included in the query.  Thanks!

Technical Evangelist
Posts: 132
Registered: ‎08-05-2015

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Is the query / parcels a WMPS layer? Or WFS?

Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

[ Edited ]

The query is from a WMPS layer as are all the features in legend except for imagery which is from WMS 

Staff
Posts: 294
Registered: ‎11-05-2015

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Hi, geoquery!

 

The tooltip definition, that you have provided in GeoMedia Desktop's Map Window prior to publishing into a WMPS, will be used only if you display the Map, or create an analysis based off a Legend Entry of such a Map.

If your query is based off a Feature Class, there is no way for WMPS to match a tooltip definition to it.

 

How exactly is your query defined? Is it defined using a Legend Entry, or a Feature Class?

Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Thanks - Is there a way to modify the query locate order like in GeoMedia either by making the query non-locatable or lower in order  of legend?  I tried doing this non-programatically (from SDK Map Display) using legend interface for query entry but it didn't seem to make any difference. There are several different parcel queries - by parcel #, by parcel owner_name, by drawing a line, circle, or polygon.  I use a style with color fill (but transparent) so that the whole border of the parcel is highlighted when mouse passes over it  (otherwise sometimes only part of boundary is hightlighted - got that trick from Frank)  Code for query by parcel number is below:.  

function QueryFind(aparcel) {

                var string3;
               
                }
                
                var qName = "ParcelQuery"
                document.getElementById('dialogbox').style.display = "none";
                document.getElementById('dialogoverlay').style.display = "none";


                style4 = new Intergraph.WebSolutions.Core.WebClient.Platform.Style.AreaStyle(null, {
                    styles: [{
                        type: "SimpleLineStyle",
                        color: "#00ff00",
                        
                        width: 3
                    }, {
                        type: "SimpleFillStyle",
                        //    color: "#00ff00",
                        //    translucency: 0.7,
                        translucency: 1.0,
                        
                        color: "#ffffff"
                    }]

                });

                $GP.crs.setCurrent("EPSG:3436", function () {
                    $GP.queries.add({
                        queryName: qName,

                        featureClassId: "D982BC597ACE629341904ADA4C432B175CC79CFA|MasterParcels_View",

                        url: "http://count-gis/jd1/MapService.svc",
                        applicationId: "JD_GOV",
                        definitionName: "MapPublisher",

                        style: style4,
                        addToLegend: true, filters: [
                        {
                            operator: "like",
                            operands: ["Parcel_ID", aparcel]
                        }],
                    },
                     function (result) {
                         $GP.queries.find({
                             analysisId: result.analysisId,
                         }, function (result2) {

                             if (result.updated) {
                                 //        $GP.ui.info("Analysis updated");

                                 //      return;
                             }
                             //  result2.analysis.addToDataView(),
                             $GP.queries.find({
                                 analysisId: result.analysisId,
                             }, function (result2) {
                                 result2.analysis.getData(

                                 function (res) {
                                     var i = 0;
                                     do {
                                         i += 1;
                                     } while (res.data[i]);
                                     //     $GP.ui.info("Total # of queries = " + i);

                                     iicount = i - 1;
                                     var string1 = JSON.stringify(res.data[iicount].features);
                                     var string2 = string1;


                                     if (string1.length < 200) {
                                         a = "<h3>Parcel with ID " + aparcel + " could not be located.</h3></center";
                                         document.getElementById('dialogboxhead').innerHTML = "Query by Parcel ID";
                                         document.getElementById('dialogboxbody').innerHTML = a;
                                         document.getElementById('dialogboxfoot').innerHTML = '<button onclick="Prompt.cancel()">Exit</button>';
                                         dialogbox.style.left = "50px";
                                         dialogbox.style.top = "50px";
                                         dialogbox.style.height = "200px";
                                         dialogoverlay.style.height = "200px";
                                         document.getElementById('dialogbox').style.display = "block";
                                         document.getElementById('dialogoverlay').style.display = "block";

                                         //aBody = a;
                                     }

                                     if (string1.length > 200) {
                                         a = "<h3>Parcel Query Results </h3><form><table class='marroonTable'>";
                                         a += "<tr><td>Parcel Number</td><td>Owner Name</td><td>Site Address</td>";
                                         a += "<td>Total Acres</td></tr>";

                                         do {
                                             var pos1 = string1.indexOf("ID") - 2;
                                             var pos2 = string1.indexOf("}}");
                                             var str2 = string1.slice(pos1, pos2);
                                             str2 = str2 + "}";
                                             var obj = JSON.parse(str2);

                                             a += "<tr><td>" + obj.Parcel_ID + "</td>";
                                             a += "<td>" + obj.Owner_Name + "</td><td>" + obj.site_address + "</td><td>";

                                             var bbbox = [Number(obj.xlo) - 1320, Number(obj.ylo) - 1320, Number(obj.xhi) + 1320, Number(obj.yhi) + 1320];
                                             a += obj.Total_Acres + "</td></tr>";
                                             parcelZoom(bbbox);

                                             string1 = string1.slice(pos2 + 1, string1.length);
                                         } while (string1.length > 200);

                                         // a += "</table><br><input type='button' value='Export to Excel'  id='btnExcel' />&nbsp;&nbsp;<input type='button' value='Export to HTML'  id='btnHTML' />&nbsp;&nbsp;<input type='button' value='Export to PLOT'  id='btnPLOT' /></form>";
                                         a += "</table><br><input type='button' value='Export to Excel'  id='btnExcel' />&nbsp;&nbsp;<input type='button' value='Export to HTML'  id='btnHTML' /></form>";
                                         document.getElementById('dialogboxhead').innerHTML = "Query for Parcel: " + aparcel;
                                         document.getElementById('dialogboxbody').innerHTML = a;
                                         document.getElementById('dialogboxfoot').innerHTML = '<button onclick="Prompt.cancel()">Exit</button>';
                                         document.getElementById('dialogbox').style.display = "block";
                                         document.getElementById('dialogoverlay').style.display = "block";
                                         dialogbox.style.left = "50px";
                                         dialogbox.style.top = "50px";
                                         dialogbox.style.height = "300px";
                                         dialogoverlay.style.height = "300px";
                                         document.getElementById('btnHTML').onclick = function () {
                                             string3 = ConvertToHTML(string2);
                                             download(string3, 'ParcelByID_' + aparcel + ".html", 'text/html');
                                               }
                                             document.getElementById('btnExcel').onclick = function () {
                                                 string3 = ConvertToCSV(string2);
                                                 download(string3, 'ParcelByID_' + aparcel + ".csv", 'text/x-csv');
                                             }
                                             document.getElementById('btnPLOT').onclick = function () {
                                                 string3 = ConvertToPLOT(string2);
                                                 download(string3, 'ParcelByID_' + aparcel + ".txt", 'text/plain');
                                             }

                                         }
                                     });
                                 });
                             });
                         });
                     });
                }
Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Also can you point me to an example of querying based on legend entry?  thanks!

Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Thanks very much - is there an example i can refer to?  I am using featureclassid below - should i be using something else?...Full code for my query submitted in  original response...

addToLegend : Boolean (optional)
add query to the legend or not. It is recommended to add the analysis legend item with a separate addToMap call on the {Analysis} object.

Defaults to: true

mapServiceId : String (optional)
map service id. Either mapServiceId or (url and definitionName) must be provided

queryName : String (optional)
Display name of the analysis legend item. If analysis with this name already exists, it is updated.

queryId : String (optional)
ID of the analysis legend item. If analysis with this id already exists, it is updated.

url : String (optional)
map service url

definitionName : String (optional)
map service definition name (for example "WFS")
featureClassId : String (optional)
feature class ID

applicationId : String (optional)
Application ID (GWMPS)

mapStateId : String (optional)
map state ID

filter : Object (optional)
filter

style : Object (optional)
style

callback : Function (optional)
Regular Contributor
Posts: 248
Registered: ‎05-01-2016

Re: URGENT! - Adding a query causes tooltips to not display in SDK Portal Webpage

Is there an example of creating a query off of a legend entry? 

Would i use something other than featureClassId:

 

Thanks....

 

$GP.queries.add({
                            queryName: qName,

                            featureClassId: "E3F07F7628A6C9B15E5D9112D5B48656529775CC|SubdivisionLots",
                            url: "http://count-gis/jd1/MapService.svc",
Polls
Please register to vote
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.