I have a problem with GMAP module which is not showing location markers on the map.
I have done some test site where location markers were shown correctly.
Then I have made second test site from scratch (to clear a bit the mess from first one) and discovered that despite GMAP focused on correct area I could not locations marekers.

I thought that I messed something in the module/view/content type config but i could not find any differences between 1st and 2nd site.
Finally I checked network logs and found 404 (not found) error line
<script type="text/javascript" src="sites/default/files/js/gmap_marker.js"></script>

I checked content of of my localhost server site's sites/default/files/js/ and found only file gmap_markers.js (written with 's')
A few lines above i found reference to correct existing file gmap_markers.js
<script type="text/javascript" src="http://localhost/asen/sites/default/files/js/gmap_markers.js?mj2yix"></script>

I have deleted files in sites/default/files/js/, flushed caches and run cron. It did not help.
Non elegant fix was to copy and rename gmap_markers.js -> gmap_marker.js.

Still question is why 2nd site's rendered content is referring to non existing file in sites/default/files/js/ ?

Comments

DRMft.BT’s picture

got the same problem here. i think its with the path of the marker.js
so you maybe got in your logs somthing like
http://localhost/asen/sites/default/files/js/gmap_markers.js?mj2yix
not found and the asen directory doesnt exist.
normaly the link should be like
http://localhost/sites/default/files/js/gmap_markers.js?mj2yix

GregGy’s picture

I have changed my configuration to so here is what I have

My site directory is /var/www/asen.pl
Apache site config is set to open URL www.asen.pl
Drupal is installed in the above /var/www/asen.pl directory (instalation according to the Guide).
Base URL is now http://www.asen.pl/

I have deleted files in /var/www/asen.pl/sites/default/files/js
I have flushed caches and run cron
After that in the ../js directory appears only one file gmap_markers.js

I go to the View with gmap and again check logs and see 404 error http://www.asen.pl/sites/default/files/js/gmap_marker.js

Question is why Drupal is calling gmap_marker.js (singular) while there is only file gmap_markers.js (plural) ?

In my previous post i have written that I had made copy of gmap_markers.js (plural) and saved it as gmap_marker.js (singular).
This applies to current example. Copying and changing name of the .js file I'm able to see markers on the map.
Could it be problem with the script that puts file into /var/www/asen.pl/sites/default/files/js or withe module that references wrong filename ?

(Singular) gmap_marker.js file exists in another directory location and is also referenced by the same View.
This is weird because page is looking for the file in to different locations
200 OK on http://www.asen.pl/sites/all/modules/gmap/js/gmap_marker.js?mj9daz

drtrueblue’s picture

module is looking to a file that doesn't exist "gmap_marker.js"

seaneffel’s picture

Follow the issue I've opened here:
http://drupal.org/node/1946494

ethanhinson’s picture

So there are a few things going on here:

1. Marker cache is generated via the function gmap_regenerate_markers(). Upon inspection, you'll see that it exists if the context calling the function is from the cli. Running cron via wget will never regenerate markers.

2. Gmap uses variables to store the file id and never write anything to the file usages table. This means that during garbage collection, the js file is deleted. Because the logic in Gmap module only checks to see if the variable is set and not that the file exists it doesn't get regenerated at render

3. Solution: We can implement hook_gmap and regenerate markers as needed. I've rolled a sandbox module here: https://www.drupal.org/sandbox/ethanhinson/2535388

ethanhinson’s picture

So there are a few things going on here:

1. Marker cache is generated via the function gmap_regenerate_markers(). Upon inspection, you'll see that it exists if the context calling the function is from the cli. Running cron via wget will never regenerate markers.

2. Gmap uses variables to store the file id and never write anything to the file usages table. This means that during garbage collection, the js file is deleted. Because the logic in Gmap module only checks to see if the variable is set and not that the file exists it doesn't get regenerated at render

3. Solution: We can implement hook_gmap and regenerate markers as needed. I've rolled a sandbox module here: https://www.drupal.org/sandbox/ethanhinson/2535388