bbcode for clickable latitude,longitude pair

Comments & questions about this site.
Post Reply
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post 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.
User avatar
Uncle Rico
Posts: 1439
Joined: Thu Mar 20, 2008 7:48 pm

Post by Uncle Rico »

I tried editing a post to add the clickable link, but failed.

I'm an idiot.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post 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?
User avatar
HikeUp
Posts: 3932
Joined: Thu Sep 27, 2007 9:21 pm

Post 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.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post 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.
User avatar
Uncle Rico
Posts: 1439
Joined: Thu Mar 20, 2008 7:48 pm

Post 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.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post 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.
User avatar
Sean
Cucamonga
Posts: 4052
Joined: Wed Jul 27, 2011 12:32 pm

Post 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.
User avatar
Tom Kenney
Posts: 385
Joined: Sat Sep 29, 2007 7:51 pm

Post by Tom Kenney »

Very nice! 36.2379,-118.3749 - this is using Sean's example with text, link works but no text subst.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post by dima »

I CAN trivially make it url-like. Do we want that?
User avatar
Tom Kenney
Posts: 385
Joined: Sat Sep 29, 2007 7:51 pm

Post 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.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post 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.
User avatar
Sean
Cucamonga
Posts: 4052
Joined: Wed Jul 27, 2011 12:32 pm

Post 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.
User avatar
Uncle Rico
Posts: 1439
Joined: Thu Mar 20, 2008 7:48 pm

Post 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.
User avatar
dima
Posts: 1521
Joined: Wed Feb 12, 2014 1:35 am
Location: Los Angeles

Post by dima »

It's not your fault this thing is picky. Making it less picky is much more work, unfortunately. Sorry.
Post Reply