Closed (fixed)
Project:
GMap Module
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2008 at 15:34 UTC
Updated:
20 Jan 2011 at 22:37 UTC
At the moment views gives me the map size specified in gmap settings - small because I like the field small for my users when choosing locations on the map in content type forms. Otherwise it overwhelms the form.
Is it possible to alter the size of gmaps in views so that they are bigger than my defaut setting which I need for my content type forms?
Comments
Comment #1
tom_o_t commentedPut a gmap macro in the views argument handling code, something like:
(remember - don't include the php tags)
Comment #2
tom_o_t commentedComment #3
eggthing commentedThat is great. Thanks! ...any way to assign color of the balloons by content type in that macro code?
Comment #4
tom_o_t commentedI've never found a way to change the color of the balloons. They're pretty much set by the Google Maps API. With CSS you can style what's inside the white bubble, but that's pretty much it. To have custom info-windows/bubbles you'd need to do a lot of custom coding. There's an example of how to do it at http://danmarvelo.us/older/2007/9/10/custom-info-window-for-google/ but it would take a good understanding of the GMap module to bring this into Drupal.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
najibx commentednice. then if we can put gmap macro in the views argument handling code, we also add zoom level as well. done.
Then, we could also specify a center for each term, and let the views put the center dynamically? or even zoom level dynamically depending on the term?
Gmap taxonomy support, only allow different marker for terms. not setting center, and zoom level. Maybe use taxonomy fields, and query directly from there?
Say for country zoom=3, state zoom zoom=8, I also need to specify the center too.
Comment #7
najibx commentedComment #8
NigelC commentedDoes anyone know how to do this in views2?
It seems that the "argument handling code" field is gone and replaced with php validators per field.
I know that we can put gmap macro's for the entire view, but I would like to change the center point based on a views argument (more specifically a postal code -> lat/long lookup for my center point).
The end goal is to implement a postcode argument which is ONLY used to center the map - it will not be used as an argument to reduce the number of matching nodes. My plan was to return FALSE in the php validator and have it set to "display all values", but in the validator code I would reset the gmap macro. But nothing seems to happen - my gmap macro is ignored.
Comment #9
agileware commentedAs far as I know it is just the macro setting for the entire view.
Having the ability to have a dynamic macro setting would be a new feature request.
Best to open a new issue for that.
Comment #10
kbk commentedUsing the code from #1 set the width but not the height (Views 6.x-2.10, Gmap 6.x-1.x-dev) until I inserted an extra semi-colon. Don't understand why just thought I'd share:
Comment #11
lazar.vuckovic commentedThank you very much for the example, it saved me after 3 days of hair pulling!
Comment #12
eiland commentedSee also #954384: How to alter gmap macro with php for a different approach, allowing php to alter the GMAP macro.
Comment #13
mttjn commentedPlease, where exactly did you put this code?
Thank you.
Comment #14
kbk commented@mttjn, after you create a View (Type Node) you set the Style to GMap. Then click on the gear image to the right of the GMap style to adjust the settings and place the mentioned code into the Macro field.
FWIW, I precede the above code with [gmap] in the macro field.
Comment #15
mttjn commented@kbk Thank you! :)