Select to view content in your preferred language

ArcGIS Explorer FeatureLayer - Popup in C#

1120
8
05-12-2010 05:11 AM
TeoD_Smyrni
Emerging Contributor
Does anyone knows by chance how i can programatically change which parameters will be displayed in Pop-up of a Feature Layer I added from .gdb ...

I mean you can do it by hand (i mean through interface), is there any chance to add a piece of code which will do it automatically...

Prefer C#, but any piece of code will be appreciated. ( no brainfuck please 😄 )

P.S. Yes, know how to use Google and help files it is not there...
0 Kudos
8 Replies
TeoD_Smyrni
Emerging Contributor
I am 1 step from excepting code in brainfuck, smallfuck or even assembly...
0 Kudos
ShellyGill2
Regular Contributor
There's no way to do this programmatically currently in Explorer, and the only workarounds I can think of would involve filtering the fields by creating a second feature class with only the required ones (I know it's not feasible for everyone).

I have added this request for a future version of ArcGIS Explorer, although I'm afraid I think it's unlikely that it will make it in to the upcoming version (1500), because we already have a full development schedule.
0 Kudos
TeoD_Smyrni
Emerging Contributor
One more question. Public subfield of type "PopupFeatureLayerProperties" is seen during debug, why can't i access it, neither find this class in the Mapping namespace ?
0 Kudos
TeoD_Smyrni
Emerging Contributor
MapDisplay md = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
bool var = false;
FeatureLayer lr = null;
for (int i = 0; i < md.Map.GetMapItems<Layer>().Count; i++)
{
lr = md.Map.GetMapItems<FeatureLayer>();

if (lr.Name.Trim().StartsWith("MY_LAYER")) break;
}


lr.Connect();

PopupFeatureLayerProperties ppp = lr.PopupProperties;

//I leave last two fields here, but you can play as u want with "ppp.PopupFields" add-remove it.d.
while(ppp.PopupFields.Count > 2) ppp.PopupFields.RemoveAt(0);

Is it a top-secrete government level property or you should fire the guy who does documentation...? cheers!
0 Kudos
ShellyGill2
Regular Contributor
What you're using there is the internal API - this is unsupported, undocumented, not exposed in intellisense, and the most important thing is it's subject to change at any release. If you're happy using this in the current release and its working for you, then just be aware that in a future release your add-in might bomb, so make sure you recompile on all future releases and re-code/redistribute if necessary.

Cheers,
0 Kudos
TeoD_Smyrni
Emerging Contributor
As far as I remember, one my ArcGIS Map extension written in ArcMAP compiled under 9.3.0 wasn't working in 9.3.1, so i guess i'll have to recompile it anyway. Plus, it problem of the Mayor of Great City of Istanbul after this point. 😄 Thanks anyway.
0 Kudos
ChorcheD
New Contributor
MapDisplay md = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
bool var = false;
FeatureLayer lr = null;
for (int i = 0; i < md.Map.GetMapItems<Layer>().Count; i++)
{
lr = md.Map.GetMapItems<FeatureLayer>();

if (lr.Name.Trim().StartsWith("MY_LAYER")) break;
}


lr.Connect();

PopupFeatureLayerProperties ppp = lr.PopupProperties;

//I leave last two fields here, but you can play as u want with "ppp.PopupFields" add-remove it.d.
while(ppp.PopupFields.Count > 2) ppp.PopupFields.RemoveAt(0);


Is it a top-secrete government level property or you should fire the guy who does documentation...? cheers!


hey...
do u have more informations about secrete classes of SDK? 😛
it could by very useful...
ty
0 Kudos
TeoD_Smyrni
Emerging Contributor
Yes, If use
m_applictation.DoItNice();
your add-on will open mapInfo's website 😉
0 Kudos