Jump to content

TextformatterGoogleMaps


teppo
 Share

Recommended Posts

7 minutes ago, doolak said:

So it seems to be CKEditor which produces the problem - tried to set  config.forceSimpleAmpersand in CKEditors config.js, but no success.  Any idea?

 

No, it wasn't CKEditor - modified it in the module now and it seems to be ok.

Link to comment
Share on other sites

  • 2 years later...

Hi @teppo,

Would you consider updating this module to allow it to parse out degrees/minutes/seconds coordinates as an alternative to latitude and longitude? This is for the "Use coordinates?" option.

The reason being that the lat/lng coordinates in a typical Google Maps URL that a person might embed are less accurate than the degrees/minutes/seconds coordinates that are also present in the URL. I have no idea why this is and it seems strange as lat/lng is capable of achieving the same accuracy in principle, but I've tested several maps and there seems to be a real difference.

Here's an example...

I'll start with a Plus code so as not to involve either lat/lng or degrees/minutes/seconds to begin with: H85C+MG Otatara, Southland, New Zealand

A search for this Plus code results in the following URL: https://www.google.com/maps/place/46°26'26.9"S+168°19'16.7"E/@-46.4408088,168.3191238,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d-46.4408125!4d168.3213125

The marker is at the end of the road, at the edge of the green reserve area:

2018-12-21_151120.png.fd7c115f39572fae4e1c97bd0a4440b7.png

But when I embed the map via TextformatterGoogleMap with the "Use coordinates" option checked the marker position is out by a significant distance:

2018-12-21_152321.png.b5b8ff4e123f58a341211a17f4ac8b3c.png

This is not the module's fault - the lat/lng coordinates that Google puts in the URL are simply not accurate. If I search the coordinates -46.4408088,168.3191238 directly the pin is similarly misplaced:

2018-12-21_151636.png.a14f43cce81fe4bac4ddcfd719033e78.png

A search for the degrees/minutes/seconds coordinates 46°26'26.9"S 168°19'16.7"E from the URL results in a correct marker placement:

2018-12-21_151853.png.e76a5adef5a1c695a8221dead4dec069.png

So seeing as the degrees/minutes/seconds coordinates are more accurate could the module provide an option to use those?

Link to comment
Share on other sites

Hey @Robin S - this is quite strange ?

46°26'26.9"S 168°19'16.7"E 

actually converts to:

-46.44080555555555, 168.32130555555554

which you can see is perfectly accurate: https://www.google.com/search?q=-46.44080555555555+168.32130555555554

What is weird is that when you click on the map it shows rounded decimal values which are close to the values you are referencing above (but not quite).

image.png.5ada47cd0399c2909be31162da74e875.png

I have no idea why ?

I have also never seen plus codes until now but they certainly look interesting, although I have always though of decimal degrees as the gold standard for lat/lng coordinates.

None of this helps you - just continuing the discussion ?

  • Like 1
Link to comment
Share on other sites

5 minutes ago, adrian said:

What is weird is that when you click on the map it shows rounded decimal values which are close to the values you are referencing above (but not quite).

image.png.5ada47cd0399c2909be31162da74e875.png

I have no idea why

This part is fine (the very slight rounding isn't enough to make much of a difference). The problem is that the lat/lng coordinates in the URL do not match those shown in the blue box, and it's the ones in the URL that matter for the textformatter.

2018-12-21_155928.png.3f5a399109380effe70bb989cec59be4.png

  • Like 1
Link to comment
Share on other sites

Ah I see your point now ? 

I guess I thought you'd be able to paste:

https://www.google.ca/maps/place/-46.44080555555555,168.32130555555554

directly into the RTE and the formatter could work with that, but Google redirects that link to:

https://www.google.ca/maps/place/46°26'26.9"S+168°19'16.7"E/@-46.4408056,168.3191169,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d-46.4408056!4d168.3213056

which is where things start going wrong.

It is strange to me that they use DMS as the actual identifier.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...