When I display both blocks, the map won't display in Firefox 8 nor Internet Explorer 9.
IE 9's debugger says something like: "Invalid value for property <zoom>: 10".
If I change the line in route_planner.js from:
zoom: Drupal.settings.routePlanner['zoomlevel'],
to
zoom: Math.round(1 * Drupal.settings.routePlanner['zoomlevel']),
the map is displayed correctly.
(I thought this had to do with type because the debugger in IE 9 shows the value of the zoomlevel property in double quotes; but it also does that if I perform the replacement shown above, so I have no idea whether and why my fix actually works.)
Comments
Comment #1
bofrost commentedCan you please make a screenshot of your settings? Thx
Comment #2
brankoc commentedSee attached files.
Comment #3
bofrost commentedThis is very strange... I tried your settings and everything works fine...
On a Mac... Have tried a other OS with your site?
You say:
IE 9's debugger says something like: "Invalid value for property : 10".
Have you tried to manipulate the zoom level in the js over the debugger or in the file?
Why must we round this value?
Comment #4
brankoc commentedNo, I've only tried Windows. The site is live now, so I cannot really revert my patch at the moment.
I tried my change in the file.
As I wrote in the report, I don't know why this would work. Javascript only has a float number value, so a value of 8 should be just as fine as 8.00001. Maybe this is something on the Google Maps site?
Ah, here's something interesting:
1. I installed the module fresh on a D7 installation. (Version 7.x.1.0.)
2. Made a block with the planner, Google Map shows fine.
3. Went to the module settings, did not change anything, just saved the settings. Google Map no longer shows and Firebug shows an invalid value error.
4. Went to the block configuration, did not change anything, just saved the settings. Google Map shows fine.
5. Went to the module settings, changed the default address to "Amsterdam, The Netherlands", saved. Google Map no longer shows and Firebug's console displays the old error again: "Invalid value for property : 10"
6. Went to the block configuration, did not change anything, saved the configuration. Google Map shows fine.
This suggests some kind of caching problem.
(/me debugs some more...)
Ah, now I may be getting somewhere. When I put something like
in your code just after the point where the myOptions object is defined, I get the same results before and after saving the block. However, if I change this to
the 'before' result for the zoom level value becomes string, and the 'after' result becomes number. This would explain why the Google Maps code is having a problem, but I still don't know why the Drupal.settings object would first return a string and then a number.
Ah, one more thing: I just tested this on my iPad, and I get the same buggy results on that device.
Assuming this is simply a block cache problem, the simple solution would be to make sure the person who acts as editor or web master saves the block after changes to the module settings, but a fix would be preferable.
Comment #5
bofrost commentedI found a solution for your problem and added it to the dev version.
Comment #6
bofrost commentedI found a solution for your problem and added it to the dev version.