1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Google Maps Element

Discussion in 'Community' started by grossr, Sep 24, 2021.

  1. grossr

    grossr New Member

    Level: Community
    Is there a MooTools version issue? Is that something I could update? (Need to buy a Java for dummies book) :)
     
  2. grossr

    grossr New Member

    Level: Community
    I don't think it's template based, switched to ProStar and receiving the same issues.
     
  3. lousyfool

    lousyfool Well-Known Member

    Level: Community
    Well, with Protostar you don't have the warning about
    Code (Text):
    https://fishnsgb.com/templates/etfishing/css/bootstrap.min.css.map
    anymore, of course. That's clearly a template thing (only look at the URL), but as said before, not affecting the map anyway.

    As for Mootools, nope, you don't want to simply "update something". (BTW, it's Javascript. That and Java are two very different things. ;))
    Anyway, google the Array.from() error, and you'll find plenty of pointers to the mentioned incompatibility, even in the J! issue tracker.

    But... do you really need the satellite view? Street view is working fine...
     
  4. grossr

    grossr New Member

    Level: Community
    It's for mapping fish caught in the bay/river. With satelite, it's easier to find where you were with your boat..., i.e., by the clump of tree's, etc.
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Community
    You say it was working before with satellite and stopped suddenly?

    On my test site satellite is working in details view if "Use static map" is set to static
     
  6. grossr

    grossr New Member

    Level: Community
    So it's a fabrik thing. Do you think installing an older version would help?
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    No, I can see the same with Fabrik3.9.2 /php7.3
    If it WAS working before (I don't know, I didn't use satellite) Google may have changed something recently (e.g. not longer accepting some v2 access or so).
     
  8. grossr

    grossr New Member

    Level: Community
    That would explain why it mysteriously stopped working...
     
  9. grossr

    grossr New Member

    Level: Community
    troester likes this.
  10. troester

    troester Well-Known Member Staff Member

    Level: Community
    media\com_fabrik\js\fabrik.js around line 238 (minified version in dist/fabrik.js; with Fabrik debug=debug JS it's loading the normal one)

    I just tested and it's working!!

    v=quarterly is ok, too.
    So
    3.45 (=3.45.8b = quarterly) is running
    3.46 (3.46.6 = weekly = default) is not

    But I don't know if this is a backward compatibility issue with Fabrik or a bug in Google.
    Time until mid november to observe...
     
    Last edited: Sep 24, 2021
  11. grossr

    grossr New Member

    Level: Community
    So minimal ver from dist/fabrik.js should look like this:
    return this.eventResults=[],i&&i[e]&&(t=Array.mfrom(t),i[e].each(function(e){o?this.eventResults.push(e.delay(o,this,t)):this.eventResults.push(e.apply(this,t))},this)),this},u.requestQueue=new t,u.cbQueue={google:[]},u.loadGoogleMap=function(e,t,o){var i=("https:"===document.location.protocol?"https:":"http:")+"//maps.googleapis.com/maps/api/js?v=3.45&js?libraries=places,visualization&callback=Fabrik.mapCb"

    And regular version from media\com_fabrik\js\fabrik.js should look like:
    var src = prefix + '//maps.googleapis.com/maps/api/js?v=3.45&js?libraries=places,visualization&callback=Fabrik.mapCb';

    If so, which it's probably not, because I no nothing of coding, it's not working...
     
  12. grossr

    grossr New Member

    Level: Community
    Turned on Fabrik debug and voila, success. Vielen, vielen dank troester..
     
  13. troester

    troester Well-Known Member Staff Member

    Level: Community
    If this is really your minified code then there's some js? to much
     
  14. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    Hi,

    I had the same problem. I've patched the js files and it works now. But it does not look like a solid solution. Shouldn't we add a parameter to choose the version in the general fabrik options near the API key ?
     
  15. troester

    troester Well-Known Member Staff Member

    Level: Community
    Last edited: Oct 11, 2021
  16. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    Indeed. I've dig also this way trying to alter mootools.core.js without any success...
    Mootools is no longer used by Joomla. Do you know if Fabrik plans to leave this framework too ?...
     
  17. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    Hi there,

    Sorry to dig out this old post. But the running version of the API (3.45) is no longer supported since May. So it's defaulted back to the most recent version.
    Hence, satellite view is no longer working. I tried to hack with an older yet supported version of the API but it still produces an error on Sat view.
    Is someone found a way to turnaround ? I guess it is a js problem by the way of constructing the query ?.... Any idea ?

    Thanks
     
  18. troester

    troester Well-Known Member Staff Member

    Level: Community
    I don't think so. The map type is only an option, not in the URL.
    I think it's something Google is doing on runtime. It's working for Roadmap and Terrain, if you are starting with Satellite you can even see the satellite map showing up shortly.
    I tried to debug, Google is using Array.from, so running the function overridden by mootools... (you can also see the warning in the console).
    I assume in case of Satellite/Hybrid this is the issue. But no idea how to fix or bypass it.

    Edit:
    Satellite is working again if you replace all Array.from with e.g Array.mofrom in
    \media\system\js\mootools-core.js and
    \media\system\js\mootools-more.js
    but I don't know if this has side effects (e.g. other plugins relying on mootools)

    A similar hack is already done in media\com_fabrik\js\mootools-ext.js
     
    Last edited: Jun 6, 2022
    lcollong likes this.
  19. manasasimplecrm

    manasasimplecrm New Member

    Level: Community
    thanks it is working properly now
     
  20. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    @troester : thanks for this follow up and solution. Indeed, I saw the warning but didn't think it was the real source of the problem. Glad it works with this hack. So far, I did not notice any side effect on our site.
     

Share This Page