Drawing Geo Coordinates in a panel:
Here is my form2.cs.
Process:
- Click on Button 2
- opens a dialogue
- click on a text file to load coordinates
- Centers the panel to the coordinates
- Then it should draw in panel2
Error:
Error Loading the file: Index was outside the bounds of the array
Text File:
Code:
https://paste.mod.gg/oeyiobhpdqwb/0
Can anyone help me please.
BlazeBin - oeyiobhpdqwb
A tool for sharing your source code with the world!
3 Replies
Remember the rule, index always starts at 0
So the last index is always n-1
You initialize i = 1.
You must also check that
i + 1 is within the bounds of the array
Meaning from 0 to n-1, so you can just check if i+1 is less than length
Got it, Thank you fixed the error
https://paste.mod.gg/ycfetrvohdjz/0
I have this error
N022.38.31.376 E088.27.00.888
N022.38.29.517 E088.27.06.420
N022.38.32.913 E088.27.10.559
N022.38.49.788 E088.27.12.685
N022.38.49.217 E088.27.11.093
N022.38.51.669 E088.27.05.718
Where
Its saying
BlazeBin - ycfetrvohdjz
A tool for sharing your source code with the world!
I am guessing its seconds which are messing it up