Thanks for your message.
I am actually not trying to do a query on the Marker’s caption.
In fact, what I’m trying to achieve is what @dan1 said. I want to ask the customer for a location, store it in a input (of type geographic location). Then the user would be able to see a map with several other locations, and when the user clicks on one of these locations on the map, the marker would show a caption which would contain the distance between the clicked marker and the location stored in the input.
I believe you have everything in place to achieve this functionality (because now, when I set the marker’s caption to show the distance from the current marker to itself, it returns 0). So, in ‘origin address’ (see screenshot), instead of providing the option of current marker (which as I explained, it makes no sense), provide for example all the geographic inputs or search fields on the page).
Not sure if I explained myself correctly. Please let me know if you need more info.