• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Google map element - static map sometimes not shown

Status
Not open for further replies.

joit

Active Member
Sometimes the static map of the Google map element is not visible. Instead, there is this default broken image icon. I have no ideas where this comes from. It might even be an error from Google...
Could the Google map element be extended, so that it shows a real Google map in list view instead of the static map?

Greets
Hannes
 
Static maps are cached to avoid hitting Google limits but maybe your lists are doing to many requests anyway.
You can add a Google API key in Fabrik options.
 
Pretty much no chance of adding a full map option to list display. Setting up multiple maps using the API is non trivial, and resource intense on the page load.

When you get the broken links, are they pointing at the cache folder on your server? Have you checked to see what's going on in the cache folder? The code we use is pretty simple, we just the URL for that map to the Google static API, like

center=34.732267,-86.587593.zoom=10.size=300x250.maptype=roadmap.mobile=true.markers=34.732267,-86.587593.sensor=false.png

... and we create an MD5 hash from that string, i.e. a "random" 32 character string, and check the cache folder. If that exists, use that, if not, fetch the map image from Google with file_get_contents(), and save it in the cache.

So, you should find a folder ./cache/com_fabrik/staticmaps on your server, which has a bunch of 32 character .png file names?

-- hugh


 
OK, since this only occurs sometimes, I couldn't test it yet with the broken images. But when everything is ok, it's like this:
are they pointing at the cache folder on your server?
Yes
Have you checked to see what's going on in the cache folder? So, you should find a folder ./cache/com_fabrik/staticmaps on your server, which has a bunch of 32 character .png file names?
I can find these images in the cache folder, all is ok. It only seems that the formatting changed. On my live site with J2.5 and Fabrik 3.09 they are named like you described
center=38.8387992,0.10505569999997988.zoom=8.size=300x150.maptype=roadmap.mobile=true.markers=38.8387992,0.10505569999997988.sensor=false.visual_refresh=true.png
On my test site with J3.4.1 and Fabrik latest GitHub they look like this:
e4a89616154ba82f62414b7912972bd1.png

Besides this, I tried to get Google Maps API to work. I got an API key, pasted it into the Fabrik options and then all maps and images are gone. So there is probably something wrong ;)
I uploaded an image of the Google API overview, is this correct?
I checked the code of a site with static maps, you can find it here on my test site I provided it fabrik options
150401/index.php/fahrten
I can't find the API code as given in the Hello World example here
https://developers.google.com/maps/documentation/javascript/tutorial?hl=de#Loading_the_Maps_API
Am I missing something?

Hannes
 

Attachments

  • api.png
    api.png
    33.3 KB · Views: 384
Yup, we changed how the cache names the files in 3.1, because those file names using the literal URL strings were breaking certain file systems (illegal characters, usually). So as per my previous post, we now md5() hash the URL into a unique hex string, which just consists of 32 letters and numbers.

If the problem is happening on a 3.0 box, that might be the problem, illegal file names. Although you are posing in the 3.1 forum, so I'm assuming this is a 3.1+ issue.

I'm testing the API key stuff now. I don't typically use one, and as Google's free rate limits have gone up quite a lot in the last few years, very few of ur users actually need an API key to get round rate limiting ... so that code doesn't get tested very often. I'll get back to you in a few ...

-- hugh
 
Should be, and it works for me with or without the API key. Try cranking error reporting up to full. If the call to fetch the map is failing, it should toss an error.
 
Calling the first "static map" (Startmap M?nchen) directly the browser is showing
Die Grafik ".../cache/com_fabrik/staticmaps/0e0c4fdef1197eacc8500e338406d0eb.png" kann nicht angezeigt werden, weil sie Fehler enth?lt. (i.e. errors in image)

Image info is showing 0 KB (0 Byte)

So it seems the map image is there but empty (which I think is pointing to an issue during creation time)
 
I can remember a similar issue at one of my sites.

Following my notices I had an API key in Mar 2014, maps working
in Oct static maps had the error, deleting the API key in Fabrik options did help (I think Google changed something in API handling)
in Dec the error came back, I created a new API key which didn't do and then a 2nd one which is ok until now.

No idea why...

Maybe Fabrik shouldn't store 0B files so they (hopefully) will be created whith a new call of the map.
 
you can try to delete 0e0c4fdef1197eacc8500e338406d0eb.png and see if it's recreated on list load (or if you can see any JS error)
 
Thanks troester, deleting the 0 KB files solved the static maps problem!!!
But I have a form with googlemap plugins and they still don't show anything.
 
Looking at both issues now.

I'm guessing the 0b issue would be if Teh Goog doesn't return an actual error code on the request, like a 404, when it comes back with a response about the API not permitting the request for whatever reason.

-- hugh
 
thanks for the update!
but I'm sorry, in my case it didn't help showing the google maps
 
I did it all, J! cache, too
but it just doesn't show!

checked, the updated php file, too. The ";" is definetely in there!
nothing in the error reporting...
 
If I'm going to your form index.php/fahrten/form/3/341
I can see a bunch of JS errors (but no idea what to do)

TypeError: jQuery(...).tooltip is not a function
.../index.php/fahrten/form/3/341 Line 38

TypeError: $.fn.popover is undefined
.../media/com_fabrik/js/tipsBootStrapMock.js Line 133

TypeError: jQuery(...).popoverex is not a function
.../media/com_fabrik/js/tipsBootStrapMock.js Line 89

Error: Load timeout for modules: fab/window,fab/elementlist,element/checkbox/checkbox,element/radiobutton/radiobutton
http://requirejs.org/docs/errors.html#timeout
http://code.jquery.com/jquery-latest.min.js line 2 > eval
Line 8
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top