I'm currently working on a C# application. What I would like to do is display a map of the UK, just a JPEG image (if possible), which also, when clicked, generates geographic coordinates of the point clicked.
Ideally what I would like to move onto is displaying a marker at two points clicked with a line drawn between them but the above is my primary goal.
My issue is that I'm actually not too sure how I would go about doing this; I have done a fair bit of research into it and have since used XAML to display the JPEG, but very much unsure of what route I should now go down.
I would greatly appreciate any advice you might be able to give.
Thank开发者_JAVA技巧s,
M
Besides the scale etc. you will also need to know what Geographic coordinate system the images was created in so that you can correctly interpolate the location from the mouse position on the image and known reference points on the image.
The coordinate system flattens out the map to a 2D image, but this causes distortions which need to be taken into account. This might be an interesting read for you: A guide to coordinate systems in Great Britain
The UK is quite simple because pretty much every map uses the National Grid (defined by the Ordnance Survey). This is rectangular so you don't have to worry about curvature. If you know the national grid and pixel locations of two points on the map you can derive anywhere else using linear interpolation.
精彩评论