Jump to content
teppo

TextformatterGoogleMaps

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Just now, Robin S said:

Even if that did work, I'm hoping for something foolproof for clients because they will just tend to paste the URL straight from the address bar.

I totally agree!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. 
      EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant  
      Changelog
      005 (current version)
      - Fix bug where the Inputfield would not work properly within repeaters / repeater matrices
      004
      - Make rounding of manually entered values configurable (floor, round, ceil or disable)
      - Fix small JS bug when the value-display field was not displayed
      - Update README
      003
      - Code cleanup, add some ModuleInfo data & LICENSE
      - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
      002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional
      001
      - Initial release
       
      Thanks!
       
       
    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...