Closed (fixed)
Project:
Simple Google Maps
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2012 at 20:36 UTC
Updated:
15 Feb 2012 at 15:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
bocaj commentedPatch attached.
Comment #2
jhodgdonLooks like a reasonable idea. Does it work? :)
Comment #3
jhodgdonOne thing I noticed in your patch: the Yes/No for "is there a marker bubble" is not translated, so it won't work well for international users:
Comment #4
bocaj commentedGood catch! Completely forgot to translate those two options.
Rerolled the patch to take care of that issue.
...and yes, it does work! :)
Comment #5
jhodgdonLooks good! I did a slightly more careful review of the patch this time, and I have a couple of concerns:
a) Generally in Drupal code (possibly this is in the coding standards, possibly not), we try to use TRUE/FALSE rather than 1/0 for Boolean options.
b) But actually.... I just noticed this in your code:
+ $marker_bubble = $display['settings']['marker_bubble'] ? 'A' : '';
I'm guessing this means to put an "A" in the marker if TRUE, and that when it's set to '', Google Maps omits the marker entirely. So maybe this could be even more generalized/useful if we made the option "Letter to display in marker" and put in the description "Leave blank to omit marker"?
c) Would this option to omit the marker bubble work on the Google Maps link as well as the embedded map? If so, can we add it there too?
d)
I don't think we really need two extra blank lines here? :)
e) One final thing... I don't think "marker bubble" is the standard term. I think it is just "marker"?
Comment #6
bocaj commenteda) How do you set a checkbox form element to have TRUE/FALSE values and not 1/0?
b) No, the "A" doesn't set the letter in the marker. This tells Google Maps what marker bubble to open by default. Google Maps always assigns the first marker A, the second B, third C, etc. Since this module will only ever have one marker, it will always be A. Therefore, if we set the iwloc parameter to A, it's telling Google Maps to open the marker bubble for A on load. An empty string means that the marker bubble shouldn't be open by default.
c) Good idea. Didn't think about this. Included in patch.
d) I have no idea how those got in there. They are removed in patch.
e) Hopefully the answer in b above answers this, but we are dealing directly with the display of the marker bubble (information bubble) not the actual marker itself. The marker will always show, regardless.
Here is an example:
Marker bubble shows on load: http://www.google.com/maps?q=123+Main+Street,+Los+Angeles,+CA&iwloc=A
Marker bubble hidden on load: http://www.google.com/maps?q=123+Main+Street,+Los+Angeles,+CA&iwloc=
Comment #7
bocaj commentedOops, forgot to change status back...
Comment #8
jhodgdone) Ahhh, the information bubble. Let's call it the information bubble then. Calling it "marker bubble" confused me into thinking it was the marker. :)
a) I'm OK on the 1/0, given your explanation.
Thanks!
Comment #9
bocaj commentedOK. Here is the (hopefully last) patch, changing all instances of marker bubble to information bubble.
Comment #10
jhodgdonLooks good! I think I'd add a code comment to that one line:
with the explanation from #6/b, so that no one would have that question again. I don't see anything else to fix though. I'll try it out sometime soon and commit it.
Do you think I should promote this to a real project instead of a sandbox by the way? So far I think you are the only user I know about (at least the only one who has reported any issues).
Comment #11
bocaj commentedAlright. This patch contains a comment explaining the information_bubble functionality.
The patch will hopefully make things easier for you as well. It contains both the information bubble functionality and the patch from #1415746: Add ability to set map zoom rolled together.
I definitely think this should be promoted to a real project. I know at least one other person that would use this pretty regularly on his projects. I'm sure there are others as well. I have been looking for this for awhile, but I couldn't figure out how to get past the coordinates issue...turned out it wasn't an issue at all :) What were you thinking for the project name, simple_gmap? I think that is a good name!
I have another idea for this project as well. How about having a block where the admin can enter an address and it renders into a map? I'm still trying to think what would be the best implementation of this. A hard-coded address wouldn't be bad, but is pretty limiting. I'm still thinking about it... :)
Comment #12
jhodgdonExcellent, thanks for the combined patch!
- simple_gmap would be the name, yes (I already chose that as the file names and function prefixes).
- Block for address rendering as a map... hm... I think you could pretty easily just do that with a View that references the node you've attached this field to, so I don't think it's necessary to add to this module. A patch for the README that makes this suggestion would be fine though. :)
Comment #13
bocaj commentedI suppose the view for the block implementation would probably work for most (maybe all) cases. That's what I get for trying to think too much! :)
Comment #14
jhodgdonI committed the combined patch, thanks!
http://drupalcode.org/sandbox/jhodgdon/1414358.git/commit/aaec4f8
Comment #15
jhodgdonI just filed an issue for discussion about promotion to real project status:
#1415934: Make this a real project?
Comment #16
jhodgdonBy the way, I used the link-to-map formatter in a View on the client project that spurred this module. I haven't tried the embedded map in a View, but I see no reason why that wouldn't work too.
Comment #18
jhodgdonTo bocaj and anyone else following this issue...
This module has been refactored on #1416452: Make 1 formatter with options to display/not on map, link, and text rather than having multiple formatters, promoted to a full project, renamed, and there is an RC1 release. The release is not backwards compatible with the sandbox module -- if you install it, you will need to go back and choose the new formatter field on your content types and views. Going forward, my intention will be to keep the module more stable than it was during the sandbox phase!