[GIS] How to make an icon with some text to popup when I hover over it and for it not to be slow

arcgis-enginearcobjectsnet

I would like to make an icon on the screen and have hover popup text. Ideally the text will be black with a white background.

Right now my icon is a bitmap created like this

GraphicTrackerClass incidentIcons = new GraphicTrackerClass();
incidentIcons.Initialize(mapControl.Map as IBasicMap);
int graphicID = incidentIcons.Add(thisIncident.point, alertIcon);

Then I set up a hit test and would like a text popup when I hover over the GraphicTracker (should I use a different class for displaying the icon?).

AxMapControl.DrawText is fast, but I can't figure out how to customize the text and background

MapTips look really cool but I can't find a function to plot a maptip with a point and text – I've only found layer.ShowTips = true;

I tried creating a balloon callout and activating my IElement like this (but it is really slow about 2 seconds for the popup to appear) :

pGraphicsContainer = activeView as IGraphicsContainer; 
pGraphicsContainer.AddElement(pElement, 0);
pElement.Activate(activeView.ScreenDisplay);
activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, pElement, null);

I also had a bad experience experimenting with dynamicdisplay.

Below I've left the original post in case anybody wants to read it:

What are the main steps to use to improve performance for an arcengine hosted in WPF with C#. It's super slow. I made a bunch of layer invisible which helped but its still no where near being snappy / usable.

Edit:

I load DataMaps10/streets_na/StreetMap North America.mxd and turn make the following layers invisible

CanadaBoundaries, CoastalWater, Parks, Airports, Landmarks, UrbanAreas, USBoundaries(World-25m), USBoundaries(25-1.5m), USBoundaries(1.5m-0), CanadaBoundaries, CanadaCoastlineandProvinces(World-25m), CanadaCoastline(25m-0), CanadaProvinces(25-1.5m),
CanadaProvinces(1.5m-0), Exits(Numbers)(15k-0)

I haven't tried switching to Winforms, I don't exactly know how to do that.

Edit 3:

SO the problem is DynamicDisplayEnabled = true ruins EVERYTHING!

so I turn it off… but now I want text that pops up when you hover over something… I was going to use dyanmic display for that, but dynamic display turns everything to crap ! I'm super frustrated.

Best Answer

Did you try putting these layers into a Basemap layer?

This is something new with 10.0, so there's not a lot of documentation.

Or, instead of using Streetmap USA, you might want to use a layer that points to ESRI's tiled map service, which I think was generated using similar data. I've put a .lyr file here that you can download. Here's a summary of what's in the lyr file:

Data Type:  ArcGIS Map Service
Connection:     Internet
Server:     http://services.arcgisonline.com/ArcGIS/services
Name:   ESRI_StreetMap_World_2D
Operations Allowed:     Map (Display)
Map Service Type:   Cached
File Format:    JPEG
Restriction:    Sublayers can't be turned on or off

Or, if you want to use WPF, you might look into the ArcGIS WPF/Silverlight SDK, a free download.