First,
Thanks for the great module. I have used the GMap module, and Geobrowser and this module is really good compared to both of those.
I wanted to add a couple of custom icons.
I found the gmaps-builtin-icons.inc and added the following code:
$group = t('Custom icons');
$icons[$group][57] = array(
'name' => 'Brewery',
'image' => $path . 'brewery.png',
);
$icons[$group][58] = array(
'name' => 'Vineyard',
'image' => $path . 'vineyard.png',
);
I added the two PNG files to the correct directory. I set up the icon configuration, map configuration and content types. If I specify the default marker the map shows up fine.
But if I try to use the custom markers only the shadow shows up.
The only real difference between the builtin and my PNG files is the size, mine are 32x20.
Any thoughts on how to fix this?
Comments
Comment #1
emersonlenon commentedOk quick update.
It is not the custom markers.
The map view I created will not show any markers only shadows.
Comment #2
xmarket commentedI think this is a file access problem.
Can you test somehow? For ex. using Firebug's netmonitor?
Comment #3
emersonlenon commentedI have not used Firebug, can you give me some pointers on how to do this?
I have installed it, but I am not sure what to do now.
Comment #4
xmarket commentedClick on the bug icon your browser's bottom-right corner
Go "Net" tab
Enable network monitoring
Reload the page, if it not occours automatically
Now you can have a list containing all the request required by this page. If you hover an item, you can see the full url of that request (use this to find your icon in the list) and optionally a tooltip box for images. If the image is accessible than the tooltip shows a preview and the size of the image, otherwise a loading icon displayed.
You can filter the list for images by clicking the "Images" button in the topmost toolbar of the firebug panel.
Comment #5
emersonlenon commentedWow that is a very cool tool!
Ok so I can see it loading the map tiles and other various images from google.com
There are two files that return a 404 Not Found Error.
1) http://www.tlc2.tld/?q=sites/all/modules/gmaps/misc/ajax-loader.gif
2) http://www.tlc2.tld/?q=sites/all/modules/gmaps/icons/red.png
As far as I can tell these paths should not be accessible in drupal in the fashion.
It looks like it is trying to load the red icon and not even the custom icons I wanted.
Does this help?
Comment #6
xmarket commentedYou found a bug...
The module doesn't support non-clean URLs. Enable them at admin/settings/clean-urls. See important notes on the bottom of the project page.
Comment #7
emersonlenon commentedSo I had a hunch that part of the problem was the ?q= in the file path. I enabled clean urls and the markers now show up.
The only thing still not working is the custom markers I added to the gmaps-builtin-icons.inc file. If I select a custom marker in the Geocoded Address field for a given content type the map uses the red balloon marker instead.
The Icon Configuration page shows the correct image for the marker icon although it lists the wrong size.
The custom icons I created are 40x40 pixels instead of the default 20x34. See the screen shot included.
One more thing, I can not delete any icon or map configurations I have created. Is that a bug or is the module installed incorrectly?
Comment #8
xmarket commentedBuilt-in icons: try to change their size in the db (gmaps_icon_config table)
Delete: as signed on the project page, these are missing features.
Comment #9
xmarket commentedBug fixed, feature added in 5.x-1.1
Comment #11
WeAreGeek commentedI have a very similar issue here, although I'm not sure it's the same.
I'm using the gmaps (Google Map Tools) module in Drupal5 and I've edited the gmaps-builtin-icons.inc file to incorporate custom images.
In the "Icon configurations" I was able to add the files and the images show up correctly.
In the "Map configurations" I've set up the map to use Marker "inherited".
In the field configuration I've set up the marker to be used to inherited.
Now if I add new content and select a built-in marker for it - it doesn't matter whether I use the icons that were already there (like 'drupal balloon') or my own images - on the map it shows up as the "red.png" icon (not even the API default! -with the black dot in it).
I checked the database and indeed: there was no width and height given. Also no shadow image nor it's width and height. Adding all these manualyy doesn't change anything as far as I can see.
When I select a 'factory icon' it does show correctly.
I do have clean URL's enabled and the "Net" tab in Firebug does give a 404 error, but that's only ajax-loader.gif (which indeed doesn't show, although it is in the correct place, world readable). It just loads "red.png" and that's what it shows on the map.
Am I doing something horribly wrong, or am I overlooking something here?