// Set the position converter. It converts the geographic coordinates
// of the objects in the XML file to planar (x,y) coordinates.
IlvProjection projection =
new IlvEquidistantCylindricalProjection();
IlvTransformer t = new IlvTransformer(0.00001,0,0,0.00001,1,6.5);
IlpPositionConverter converter =
new IlpGeographicPositionConverter(projection,true,t);
networkComponent.setPositionConverter(converter);
You can also parameterize the geographic
position converter through CSS by using the following steps:
Define
a converter class with an empty constructor.
public class MyConverter extends IlpGeographicPositionConverter {
public MyConverter() {
super(new IlvEquidistantCylindricalProjection(),
true,
new IlvTransformer(0.00001, 0, 0, 0.00001, 1, 6.5));
}
}
Reference
the converter class in a CSS file as follows.
Positioning {
positionClass: 'ilog.cpl.network.IlpGeographicPosition';
converterClass: 'my.package.MyConverter';
}
Important
The parameters used to configure an
IlpGeographicPositionConverter
should conform to the georeferencing configuration of the
background map in use. For details, see
Background support.
You can define your own application-specific implementation of
the
IlpPosition interface, for example, you
could implement polar coordinates. When you define your own
implementation of
IlpPosition
, you must also attach the corresponding implementation of the
IlpPositionConverter to the view. In this
particular case, you would attach a converter from polar
positions to the predefined view position types.
When an object has no attached position,
the view assigns a position to the corresponding graphic
object. The position is assigned through the layout mechanism
(node layout for positioning nodes, and link layout for shaping
links).
If the position of an object changes due
to user interaction, the controller requests the handler to
confirm the change.