Page 1 of 1

bbcode for clickable latitude,longitude pair

Posted: Sat Jun 15, 2024 4:33 pm
by dima
Fellow eispiraten!

I just added a custom bbcode to make latitude,longitude pairs into clickable links that route to caltopo. So instead of typing

Code: Select all

34.123,-118.456
you can type

Code: Select all

[latlon=34.123,-118.456]
And you get this: 34.123,-118.456. Clicking shows the link in caltopo, with some hard-coded zoom level and layer selection. The point in question is at the center of the map, without any marker, unfortunately. But it's better than nothing!

There are several things that can be improved here; let me know if you want to help make this nicer.

Re: bbcode for clickable latitude,longitude pair

Posted: Sun Jun 16, 2024 3:39 pm
by Uncle Rico
I tried editing a post to add the clickable link, but failed.

I'm an idiot.

Re: bbcode for clickable latitude,longitude pair

Posted: Sun Jun 16, 2024 5:02 pm
by dima
Uncle Rico wrote: Sun Jun 16, 2024 3:39 pm I tried editing a post to add the clickable link, but failed.

I'm an idiot.
This "feature" is kinda half-assed, and that's the fundamental problem here. Can you point me to the edited post?

Re: bbcode for clickable latitude,longitude pair

Posted: Sun Jun 16, 2024 10:29 pm
by HikeUp
I see that it's possible to turn BBCode off/on. I assume it must be ON?

If you can throw a football over a mountain, you can do anything.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 6:28 am
by dima
I would guess it's something silly like extra spaces (no spaces are allowed in the tag). Making this work despite the extra spaces is too much work.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 6:39 am
by Uncle Rico
I tried it on one of my Utah TRs that has coordinates and it came through not as a clickable link, but exactly as I entered it as code. So I reverted back to the original post.

Admittedly, I'm not that versed in using code so it def could be user error. BBCode is turned on.

Not a big deal.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 8:14 am
by dima
I added the bbcode to one of your earlier posts. Worked ok, after I removed the space after the comma. Definitely ot a big deal, but it'd be nice to have clickable links.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 9:24 am
by Sean
dima wrote: Mon Jun 17, 2024 8:14 am I added the bbcode to one of your earlier posts. Worked ok, after I removed the space after the comma. Definitely ot a big deal, but it'd be nice to have clickable links.
I added the link to the rest of Rico's Utah TRs. Thanks for creating this cool feature. The only non-intuitive aspect is having to remove the space between the coordinates. Also, this looks slightly odd on display. Ideally, the code should be more like the "url" tag, where you can embed the display name. For example:

Code: Select all

[latlon=34.2209,-118.0570]Mt. Wilson[/latlon]
So then "Mt. Wilson" would appear as a link to a CalTopo map centered on Mt. Wilson.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 2:18 pm
by Tom Kenney
Very nice! 36.2379,-118.3749 - this is using Sean's example with text, link works but no text subst.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 3:57 pm
by dima
I CAN trivially make it url-like. Do we want that?

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 6:47 pm
by Tom Kenney
dima wrote: Mon Jun 17, 2024 3:57 pm I CAN trivially make it url-like. Do we want that?
Is it possible to decorate the resulting link, so it looks distinct from a normal URL? Syntax is easy to remember, so that's good.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 7:10 pm
by dima
I'm not sure what you mean. I just added another url-style tag called "latlonurl". So you can do this:

Code: Select all

[latlonurl=34.2209,-118.0570]Mt. Wilson[/latlonurl]
To get this: Mt. Wilson

I guess we can keep both.

Re: bbcode for clickable latitude,longitude pair

Posted: Mon Jun 17, 2024 8:10 pm
by Sean
Tom Kenney wrote: Mon Jun 17, 2024 6:47 pm
dima wrote: Mon Jun 17, 2024 3:57 pm I CAN trivially make it url-like. Do we want that?
Is it possible to decorate the resulting link, so it looks distinct from a normal URL? Syntax is easy to remember, so that's good.
Make it distinctive with the context of your sentence and the display name of the link.

Click here for a topo map of the trailhead.

The trailhead coordinates are: 34.21487, -118.14755.

Park at the Chaney Trail gate.

Re: bbcode for clickable latitude,longitude pair

Posted: Tue Jun 18, 2024 7:26 am
by Uncle Rico
Sean wrote: Mon Jun 17, 2024 9:24 am I added the link to the rest of Rico's Utah TRs. Thanks for creating this cool feature. The only non-intuitive aspect is having to remove the space between the coordinates.
Thanks. I must have left a space in there somewhere when I tried it. User error...as suspected.

Re: bbcode for clickable latitude,longitude pair

Posted: Tue Jun 18, 2024 11:42 am
by dima
It's not your fault this thing is picky. Making it less picky is much more work, unfortunately. Sorry.