avigis

Issue with MapTitle in ArcObjects Java 10.1

Discussion created by avigis on Jan 20, 2013
Latest reply on Jan 21, 2013 by avigis
Hi,

In my MapViewer I want to add a MapTitle, MarkerNorthArrow, AlternatingScaleBar & ScaleText.

I am not being able to position the title correctly.

When I zoom the title disappears! but North arrow, scale bar etc remains.

I am following this http://resources.arcgis.com/en/help/arcobjects-java/concepts/engine/index.html#/How_to_interact_with_map_surrounds/0001000006mm000000/

IEnvelope env1 = new Envelope();
env1.putCoords(7, 25, 12, 20);

UID titleUID = new UID();
titleUID.setValue("esriCarto.MapTitle");
MapTitle title = new MapTitle();
title.setMapByRef(docMap);
IMapSurroundFrame titleMapSurroundFrame = docMapFrame.createSurroundFrame(titleUID, null);
String name = DEM.getName();
if (DEM.getName().contains(".")) {
 name = DEM.getName().substring(0, DEM.getName().lastIndexOf("."));
} 
titleMapSurroundFrame.getMapSurround().setName(name.toUpperCase());
IElement titleElement = (IElement)titleMapSurroundFrame;
titleElement.setGeometry(env1);
titleElement.activate(docActiveView.getScreenDisplay());
docGraphicsContainer.addElement(titleElement, 1);


Thanks,
Avishek

Outcomes