The renderer has a setting that defines where the center of a symbol is based on the Center HQ on Staff setting. This setting is true by default and basically means that if a symbol is made an HQ, the center of the symbol is the free end of the staff. This appears to be working correctly until I add a value for the Direction of Movement modifier.
The figure below shows a hostile ARMOR symbol that is marked as an HQ. Note that the free end of the staff is located on a dot on the map. This is the correct location.
If I turn off the HQ setting, the center of the symbol is changed is the display looks like the below picture. Again, this is correct.
However, if I set the HQ back on and add a direction of movement value of 180, this is what is shown on the display. This is incorrect.
Another example with the Direction of Movement set to 90.
I am using the center information returned from the java renderer to determine where to draw the symbol. The exact coordinates of the symbol is always the same. In my application, I convert the lat/lon coordinate of the symbol to an x/y value to draw on the map via a Graphics object. The final x/y value is adjusted based on the center of the bitmap.
// pt is the coordinate of the symbol converted to X/Y point
// symbol is a class in my project; AnchorXY is the center info returned from the renderer
float xCoord = pt.X - symbol.AnchorXY.X;
float yCoord = pt.Y - symbol.AnchorXY.Y
MapGraphics.DrawImage(image, (int)Math.Round(xCoord),
(int)Math.Round( yCoord));
The information I am receiving from the renderer for the four above examples is:
Figure 1: Center is (-1, 86) and Size is (58, 87)
Figure 2: Center is (28, 28) and Size is (58, 58)
Figure 3: Center is (-1, 173) and Size is (58, 174)
Figure 4: Center is (-1, 119) and Size is (58, 120).
If appears that if the HQ flag is set, the render will always set the X value of the symbol to -1 (at least for Hostile symbols) and the Y value to the height of the symbol -1 (again, at least for Hostile symbols).
Can you please verify my findings and hypothesis for this issue?
The renderer has a setting that defines where the center of a symbol is based on the Center HQ on Staff setting. This setting is true by default and basically means that if a symbol is made an HQ, the center of the symbol is the free end of the staff. This appears to be working correctly until I add a value for the Direction of Movement modifier.
The figure below shows a hostile ARMOR symbol that is marked as an HQ. Note that the free end of the staff is located on a dot on the map. This is the correct location.
If I turn off the HQ setting, the center of the symbol is changed is the display looks like the below picture. Again, this is correct.
However, if I set the HQ back on and add a direction of movement value of 180, this is what is shown on the display. This is incorrect.
Another example with the Direction of Movement set to 90.
I am using the center information returned from the java renderer to determine where to draw the symbol. The exact coordinates of the symbol is always the same. In my application, I convert the lat/lon coordinate of the symbol to an x/y value to draw on the map via a Graphics object. The final x/y value is adjusted based on the center of the bitmap.
The information I am receiving from the renderer for the four above examples is:
If appears that if the HQ flag is set, the render will always set the X value of the symbol to -1 (at least for Hostile symbols) and the Y value to the height of the symbol -1 (again, at least for Hostile symbols).
Can you please verify my findings and hypothesis for this issue?