Quantcast
Viewing all articles
Browse latest Browse all 2341

Commented Unassigned: DrawPoint not working [25996]

Hello,

I'm just doing some testing for an application, I'm using the AxMap.DrawPoint method but when I go through the process, no point is being drawn on the map:

private void button1_Click(object sender, EventArgs e)
{
axMap1.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR;
axMap1.TileProvider = tkTileProvider.OpenStreetMap;

int draw = axMap1.NewDrawing(MapWinGIS.tkDrawReferenceList.dlScreenReferencedList);

double x = -167180.44;
double y = 6888731.71;
int pixel = 10;
uint color = 255;

axMap1.DrawPointEx(draw, x, y, pixel, color);

//axMap1.Redraw();
}

If I use the Lat, Long values, it draws a point but it's well of where it should be.

Any help will be greatly appreciated.

Thanks

Brendan
Comments: Well, an obvious thing to point out - you created screen referenced layer (tkDrawReferenceList.dlScreenReferencedList) while your coordinates are definitely not screen ones. You should try dlSpatiallyReferencedList instead. Also coordinates should be in the same projection as set for the map. Otherwise you need to convert them manually using GeoProjection class. Also [methods of AxMap described here](http://www.mapwindow.org/documentation/mapwingis4.9/group__map__coordinates.html) can be useful .

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>