Page 1 of 2
CGStaticMaps - No image
Posted: Wed Mar 30, 2016 7:40 am
by naturelab
I cannot get CGStaticMaps to function.
Fresh install / Minimal template.
Code: Select all
{CGStaticMaps address='Paris FR' center='Paris FR' marker0='Paris FR' marker1='Amsterdam NL' zoom=12 markercolor='#efefef' size='250x250'}
http://diwana.co.uk/index.php
Am I using it incorrectly ?
Version / modules
Code: Select all
----------------------------------------------
Cms Version: 2.1.2
Installed Modules:
AdminSearch: 1.0
CGBlog: 1.13.3
CGContentUtils: 2.1
CGExtensions: 1.52.2
CGGoogleMaps2: 0.99.3
CGSimpleSmarty: 2.0.5
CGSnapshot: 1.0
CGStaticMaps: 1.0.0
CMSContentManager: 1.1
DesignManager: 1.1.1
FileManager: 1.5.2
FormBuilder: 0.8.1.3
Gallery: 2.1.3
JQueryTools: 1.3.8
MicroTiny: 2.0.3
ModuleManager: 2.0.2
Navigator: 1.0.2
News: 2.50.4
Search: 1.50.2
SimpleSiteInfo: 3.1
SimpleSiteMgr: 3.1.1
Re: CGStaticMaps - No image
Posted: Wed Mar 30, 2016 11:18 am
by velden
Review your html source code: it's invalid.
Re: CGStaticMaps - No image
Posted: Wed Mar 30, 2016 11:35 am
by naturelab
Ok - Sorry, that was a quick throw-up this morning
Rectified now.
Still not working though. Any ideas ?
Re: CGStaticMaps - No image
Posted: Wed Mar 30, 2016 11:42 am
by velden
Re: CGStaticMaps - No image
Posted: Wed Mar 30, 2016 11:50 am
by naturelab
All these errors come from Calguys Google Maps 2, which is a clean install. 'Fresh out the box' . I have not touched it. I was having trouble with that yesterday ( see other thread )
As CGStaticMaps, is not dependant on that module, I have removed the js associated with it.
Still no joy though.
Re: CGStaticMaps - No image
Posted: Wed Apr 06, 2016 8:40 am
by naturelab
I am still haveing trouble with this. Could anyone advise ?
I can't seem to get the extension to output.
Without format=''
Code: Select all
{CGStaticMaps address='Paris FR' center='Paris FR' marker0='Paris FR' zoom=12 markercolor='#efefef' size='250x250' alt="A map of Paris, France" }
No image displayed.
Output is :-
Code: Select all
<img id="" class="" alt="A map of Paris, France" width="" height="" src="http://diwana.co.uk/tmp/cache/cgecrf_5dbc28dd6ab64ced6583ab87ae8a4428"/>
Also note that the
does NOT seem to be having any effect.
With format=PNG or
format='PNG' or
format='png'
{CGStaticMaps address='Paris FR' center='Paris FR' marker0='Paris FR' zoom=12 markercolor='#efefef' size='250x250' alt="A map of Paris, France" format=PNG}
I get an error :-
Code: Select all
PNG is an invalid format for CGStaticMaps\map_generator
Re: CGStaticMaps - No image
Posted: Wed Apr 06, 2016 1:53 pm
by PinkElephant
Looking at 2.1.2 with CGStaticMaps 1.0.0 +(CGExtensions 1.52.2, CGSimpleSmarty 2.0.5), I can't reproduce the javascript errors and in the absence of full sysinfo this may or may not be relevant...
Code: Select all
{CGStaticMaps address='Paris FR' center='Paris FR'}
... successfully creates a png file in the cache directory;
Code: Select all
$config['tmp_cache_location'] = '/srv/example.com/public/private/cmsms/tmp/cache';
However, img src assumes the default tmp/cache location;
Code: Select all
<img id="" class="" alt="Paris FR" src="https://www.example.com/tmp/cache/cgecrf_b1e8aa2120810f4365f90d39453c612f" height="" width="">
... and will 404 as
cgecrf_b1e8aa2120810f4365f90d39453c612f lives in the non world-readable location set in config.php
Line 37 of
modules/CGStaticMaps/lib/class.saved_static_map.php shows
Code: Select all
$url = $sysconfig['root_url'].'/tmp/cache/'.basename($crf->get_dest());
I guess a fix might involve a module specific location, say,
uploads/_CGStaticMaps
Re: CGStaticMaps - No image
Posted: Wed Apr 06, 2016 4:23 pm
by naturelab
Thanks for your help.
I have eliminated ALL Javascript errors, so that can be discounted.
So, just using :-
Code: Select all
{CGStaticMaps address='Paris FR' center='Paris FR'}
, as you did, I get the same error :-
Code: Select all
"NetworkError: 404 Not Found - http://www.diwana.co.uk/tmp/cache/cgecrf_b1e8aa2120810f4365f90d39453c612f/"
I looked in the cache and The file
IS being created in the correct place, but WITHOUT the extension ( .png ). I can go and add it in manually, and it works.
Any idea what may be causing this ?
I am getting this PHP error :-
Code: Select all
PHP Warning: Parameter address is not known by module CGStaticMaps dropped in /home/.../public_html/lib/classes/class.CMSModule.php on line 652
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 1:44 am
by calguy1000
I ran some tests today and was never able to reproduce this problem exactly. I was always able to produce a map. The bug reported mentioned something about marker colors once I change the marker color to the obvious color everything worked fine it seems to me that the marker color itself was too great to be easily visible.
Either way I did make some very minor fixes to the module and I will release a new version hopefully this weekend
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 7:19 am
by naturelab
Ok Robert. Thanks for taking the time to investigate.
On my latest test, I used a very basic/ default declaration ( not involvimg marker colour ), but still no file extension / no joy.
Is there any particular PHP settings in my particular setup, that you can think of, that could be causing this ?
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 7:42 am
by velden
PinkElephant wrote:
...
Code: Select all
$config['tmp_cache_location'] = '/srv/example.com/public/private/cmsms/tmp/cache';
However, img src assumes the default tmp/cache location;
Code: Select all
<img id="" class="" alt="Paris FR" src="https://www.example.com/tmp/cache/cgecrf_b1e8aa2120810f4365f90d39453c612f" height="" width="">
... and will 404 as
cgecrf_b1e8aa2120810f4365f90d39453c612f lives in the non world-readable location set in config.php
That location is/must be world-readable. E.g. combined css files are stored there and called directly by browser.
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 7:52 am
by naturelab
Thanks.
Please excuse my ignorance, but do I have to change/ declare that path in the config file itself ?
Thanks guys
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 8:42 am
by velden
No, by default you don't.
Strange thing is that the module does output the path
http://diwana.co.uk/tmp/cache/cgecrf_b1e8aa2120810f4365f90d39453c612f
But the file doesn't seem to exist (please check).
I guess though that if folder permissions are bad, the whole CMSMS install wouldn't work.
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 8:45 am
by naturelab
Hi, It DOES exist, but it doesn't have the file extension, that's why it doesn't display.
Specifically declaring the 'format' does not work ( see errors above )
That's why I ignored the previous suggestion about the location / path odf the cache.
Re: CGStaticMaps - No image
Posted: Thu Apr 07, 2016 9:45 am
by velden
So, you're saying the file 'cgecrf_b1e8aa2120810f4365f90d39453c612f' does exist. It has NO file extension.
So, why doesn't your web server serve the file? Something in the configuration preventing it from serving files without extension? (.htaccess?)