Location on Picture 1.0

Location on Picture 1.0

for Xojo 2020r2.1 targets Desktop Windows, Linux, macOS

location on picture is a plugin control to show locations on static images.
it can show a location as filled colored circle, as icon, it can draw tracks by provided points,
it have mouse over to show locations name, it provide also click events for locations.

download
location on picture xojo example app zip

donate paypal.me/drmaschine

example screenshot to get latitude & longitude before image export.

you need to save the map in Maps sub Folder plus a textfile with minimal data.
then add the name into the city map combobox.
(it use a build step to copy this files at build.)

1 Like

Hi Markus,
great work and I would love to re use it. Have downloaded the piece of Code but unfortunately I get an Error already during compiling within the Sub “Load”

Code Line:
Var st As TextInputStream = TextInputStream.Open(dataFile)

image

Any suggestions from your side?

Thanks Bernhard

Ps: Xojo V2020R2.1
Mac Catalina

thanks :slight_smile:
i guess that is the part where the map information is loaded from a text file.
compare the build step from my example with your project.
for each map .png there should be a .txt file.
this text file contains

XLongitudeLeft = 8.842878341674806
XLongitudeRight = 8.933515548706056
YLatitudeTop = 53.83064665140622
YLatitudeBottom = 53.794720305146946

the message said there is no try catch used at method Load.
please look into io exception message for more information.

Hi,

.txt file incl content is within the /maps folder

  • the Error Message is directly out of the offered download (assume that Cuxhaven.txt should be adressed at the open call)

Here are some Screenshots:
image
image
image

What confuses me is the native path of the variable DataFile
image
because this part of the path definitely does not exist
/Location on Image.debug.app/Contents/Resources/

please click at IOExeption it hopefully show a useful message.
if you have problems with access the path you can change it in Load

Var path As FolderItem = SpecialFolder.Resources.Child("Maps")

not much in
image

… will try to change the path

Test dataFile <> Nil before this line. It is not possible to Open a Nil FolderItem.

You may eventually also test if dataFile is not a Directory too ;-).

problem is, that it already sow’s up as a bug during compilation
image

at the end it is a matter of path …
once changing the path directly to documents the code is working …

image

thanks for the support!!

1 Like

i don’t know why the Resources folder is a issue at mac.
the example at windows works fine, i would expect it works also at mac.

Is the file actually called ‘Maps’ with no extension?
If it is a text file, it shows as Maps in the IDE, but that is not what the file is called.
It remains Maps.txt (for example) in the resources folder

SpecialFolder.Resources.Child("Maps.txt")

If it is a text file, you dont even need to use textinputstream to read it.
Just assign it to a string variable.

Var contentsofMaps as string
contentsofMaps = Maps

If it genuinely has no extension, be wary of case-sensitive file systems.

Isn’t there an issue with FolderItem, API 2.0, and special characters in the path?
Try running the project from a location without a Ü character.

Edit: I see you’ve already had success with that:

1 Like

its really used as path and its all working at windows, the filename came later in this method.
i used a folder to bundle image and info files.

its worth trying a project path with ue instead of ü then. :slight_smile:

Übungs_Coding

Any way you go about it, if the path is changed to fit [a-zA-Z0-9] and the problem goes away…

use of the umlaut and spaces … 2021
unbelievable but true :exploding_head:

Thanks to both of you!!!