There are two ways to show tooltips in Netviewer, they both involve changing metadata. To enable tooltips in Netviewer, you need to add the following two lines to file Customize.inc, absolute file path “C:\Program Files\Intergraph\GTechnology\Program\GViewerApp\Customize\Customize.inc” :
var AllowToolTipsOnHover : boolean = true; var ToolTipsOnHoverDefault : boolean = true;
Once these two lines have been added the option ‘Tooltips on hover’ is added in Netviewer Options :
To enable tooltips in Netviewer when hovering over a feature you have two options, they both involve changing metadata :
- Using an Identifier View
- Use the same component for the primary graphic- and primary non graphic component
Let’s assume we have created a linear feature with 3 components, a line, a record and a label. The numbering scheme for this feature is shown in the following table :
This data was retrieved using the following query
select g3e_feature.g3e_fno , g3e_feature.g3e_username , g3e_feature.g3e_tooltip , g3e_component.g3e_cno , g3e_component.g3e_username , g3e_component.g3e_table , g3e_component.g3e_tooltip , g3e_component.g3e_lrno , g3e_component.g3e_type from g3e_featurecomponent inner join g3e_feature on g3e_feature.g3e_fno = g3e_featurecomponent.g3e_fno inner join g3e_component on g3e_component.g3e_cno = g3e_featurecomponent.g3e_cno order by g3e_component.g3e_cno;
The feature has a record with a diameter-material attribute, and the label is showing the values. In G/Designer, it looks like this :
The cursor is positioned above the line component and the standard tooltip for this component as defined in G3E_COMPONENT.G3E_TOOLTIP concatenated with the fid is shown. Also, the feature has been selected and the standard Feature Explorer tooltip as defined in G3E_FEATURE.G3E_TOOLTIP with the fid is shown.
This is the initial Netviewer view :
Notice that the cursor is positioned above the line component but no tooltip is shown.
Metadata changes for Netviewer tooltips
Let’s try to create a Netviewer tooltip showing a fid together with custom attributes MATERIAL and DIAMETER.
To show tooltips in Netviewer when hovering over a feature, you have two options :
- Use an Identifier View
- Use the same component for the primary graphic- and primary non graphic component
Use an Identifier View
Using this option, you create a special type of component called a ‘attribute-only’ component.
The following steps are needed :
- Create a label
- Create an Identifier View
- Create the ‘attribute-only’ component
- Update the feature metadata to use the Identifier view
- Update all components to use the label
- Optional:Change component views
1. Create a label
We need to define what is shown in the tooltip, this is done using a regular label:
insert into g3e_label( g3e_lfno,g3e_username,g3e_content ) values ( 120000, 'Gas Identifier View Label','F[G3E_FID]:[MATERIAL]/[DIAMETER]'); insert into g3e_labelrule(g3e_lrrowno, g3e_lrno, g3e_rule, g3e_filter, g3e_filterordinal, g3e_lfno) values( 120001, 1, 'Identifier view',null, 1, 120000);
2. Create an identifier view
This label uses the G3E_FID, MATERIAL and DIAMETER attributes and we need to define a view to fetch it:
create or replace view V_GASLINE_FE as select gas_line.G3E_FID, MATERIAL, DIAMETER from gas_line inner join gas_record on gas_record.g3e_fid = gas_line.g3e_fid WHERE gas_line.G3E_FNO=12;
This view will later be defined as an Identifier view
3. Create the ‘attribute-only’ component
An attribute-only component is a special type of component not part of a feature. An example is G3E_JOB but it also used to define your Identifier View:
Insert into G3E_COMPONENT( G3E_CNO, G3E_USERNAME, G3E_NAME, G3E_TOOLTIP, G3E_TYPE, G3E_TABLE, G3E_DETAIL, G3E_DCNO, G3E_LRNO, G3E_LTT) values ( 1204, 'Gas Line Identifier', 'V_GASLINE_FE', 'Gas Line Identifier', 2048, 'V_GASLINE_FE', 0, 1, 1, 0); Insert into G3E_ATTRIBUTE ( G3E_ANO, G3E_CNO, G3E_FIELD, G3E_USERNAME,G3E_REQUIRED, G3E_COPY, G3E_EXCLUDEFROMEDIT, G3E_DATATYPE, G3E_EXCLUDEFROMREPLACE, G3E_BREAKCOPY, G3E_COPYATTRIBUTE, G3E_WRAPTEXT, G3E_UNIQUE, G3E_FUNCTIONALVALIDATION, G3E_ROLE) values( 120401, 1204, 'G3E_FID', 'Fid', 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 'EVERYONE'); Insert into G3E_ATTRIBUTE ( G3E_ANO, G3E_CNO, G3E_FIELD, G3E_USERNAME,G3E_REQUIRED, G3E_COPY, G3E_EXCLUDEFROMEDIT, G3E_DATATYPE, G3E_EXCLUDEFROMREPLACE, G3E_BREAKCOPY, G3E_COPYATTRIBUTE, G3E_WRAPTEXT, G3E_UNIQUE, G3E_FUNCTIONALVALIDATION, G3E_ROLE) values( 120402, 1204, 'MATERIAL','Material', 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 'EVERYONE'); Insert into G3E_ATTRIBUTE ( G3E_ANO, G3E_CNO, G3E_FIELD, G3E_USERNAME,G3E_REQUIRED, G3E_COPY, G3E_EXCLUDEFROMEDIT, G3E_DATATYPE, G3E_EXCLUDEFROMREPLACE, G3E_BREAKCOPY, G3E_COPYATTRIBUTE, G3E_WRAPTEXT, G3E_UNIQUE, G3E_FUNCTIONALVALIDATION, G3E_ROLE) values( 120403, 1204, 'DIAMETER', 'Diameter', 0, 0, 0, 4, 0, 0, 0, 1, 0, 1, 'EVERYONE');
4. Update the feature metadata to use the Identifier view
Our feature definition needs to be updated to use the identifier view :
update g3e_feature set g3e_identifierview = 'V_GASLINE_FE' where g3e_fno = 12;
5. Update all components to use the label
All components part of the feature need to have their G3E_LRNO point to the labelrule to be used
update g3e_component set g3e_lrno = 1 where g3e_cno in ( 1201, 1202, 1203 );
6. Optional : Change Component Views
For Netviewer tooltips to work using this approach, all attributes used in the label need to be present in our Identifier View, t.i. V_GASLINE_FE, so we’re done with that. Each time a user hovers over a component, Netviewer dynamically queries view V_GASLINE_FE in the database.
G/Designer on the other hand constructs tooltips using the label as specified in G3E_COMPONENT.G3E_LRNO and queries the component view for it. If it can’t find any attribute, it will display the label as a literal like ‘F10:[MATERIAL]/[DIAMETER]’. So for the G/Designer tooltip to display correctly we need to update the Component View for the LINE:
create or replace view V_GAS_LINE as select GAS_LINE.G3E_ID , GAS_LINE.G3E_FNO , GAS_LINE.G3E_FID , GAS_LINE.G3E_CNO , GAS_LINE.G3E_CID , GAS_RECORD.DIAMETER , GAS_RECORD.MATERIAL , GAS_LINE.G3E_GEOMETRY from GAS_LINE INNER JOIN GAS_RECORD on GAS_RECORD.G3E_FID = GAS_LINE.G3E_FID;
The result
After these changes, the result from the earlier query looks like this :
After publishing metadata, you now see the following picture when hovering over a feature in G/Designer:
When you hover of this feature in Netviewer, a tooltip is shown :
Use the same component for the primary graphic- and primary non graphic component
This approach is easier then the first one because it involves fewer steps. The only downside may be that both G3E_FEATURE. g3e_primarygeographiccno and G3E_FEATURE. g3e_primaryattributecno need to point to the same component.
The following steps are needed :
- Create a label
- Update the main graphic component to use the label
- Declare a single component to be the main graphic- en nongraphic record
1. Create a label
As in the previous example, we need to define the contents of our label :
insert into g3e_label( g3e_lfno, g3e_username,g3e_content ) values ( 120000,'V1','F[G3E_FID]:[MATERIAL]/[DIAMETER]'); insert into g3e_labelrule( g3e_lrrowno, g3e_lrno, g3e_rule, g3e_filter, g3e_filterordinal, g3e_lfno ) values ( 120001,1,'Identifier view',null, 1, 120000);
2. Update the main graphic component to use the label
update g3e_component set g3e_lrno = 1 where g3e_cno = 1201;
3. Declare a single component to be the main graphic- en nongraphic record
update g3e_feature set g3e_primarygeographiccno = 1201, g3e_primaryattributecno = 1201, g3e_identifierview='GAS_RECORD' where g3e_fno = 12;
The result again
After these changes, the result from the earlier query looks like this :
After publishing metadata, you’ll see the following picture in G/Designer :
The same feature looks like this in Netviewer :
Summary
- Netviewer tooltips can be defined in 2 ways, the first one using an Identifierview and updating G3E_LRNO for each component, the second one by using one component as the maingraphic-/ nongraphic component
- The second one is the easiest.
- Both approached have consequences for the Tooltips shown in G/Designer
Scripts for this sample can be downloaded here.
Hope this helps, Stephan