I am trying to create a Gmap View with the data collected with this module. I have tried a few different configurations and I have not been able to make any work. In the actual node the maps show correctly using the Gmap display option.
In the Gmap View I have selected Style: Gmap with settings of, Grouping field: , Data Source: Choose Lat & Lng Fields.
I have tried using the field from my content type in every combination I can think of including: adding the field more than once with different formatting (latitude and longitude) and then selecting the correlating fields in Data Source. I have also tried having the field formatted as Gmap and then selecting that field in the Data Source.
Both of these configurations do show markers on the Gmap view, but the markers all show up in the middle of Africa (nowhere near the actual location of the pins in the node). I have confirmed the the lat and lng values that the view is displaying (in the bubble) is what is in the node edit.
If you have questions or would like me to do additional testing, please let me know and I will help out.
Cheers,
Will
Comment | File | Size | Author |
---|---|---|---|
#23 | gmap_geo_swill.patch | 3.96 KB | swill |
#14 | gmap_geo_views_plugin_patch.zip | 4.08 KB | swill |
#6 | gmap-view-style_decimal_fields.png | 162.1 KB | becw |
#6 | gmap-view-style_geo.png | 158.12 KB | becw |
Comments
Comment #1
swill CreditAttribution: swill commentedAny ideas or help on this? I need to resolve this as soon as possible.
Thanks,
Will
Comment #2
becw CreditAttribution: becw commentedHi, I suspect that either the latitude/longitude fields that Geo provides are broken (I saw a mention of that here: http://drupal.org/node/429654#comment-1627832 ) and/or GMap's ability to use separate fields as a source for coordinates is broken (in my work with GMap a few months ago this was broken, though there has been active development on GMap since then so it may have been fixed).
I'll do some research and get back to you.
Comment #3
swill CreditAttribution: swill commentedI reviewed the comment you linked. I have tried with and without the patch and I cant make it work either way. I also installed the most recent version of Geo (there have been updates since this was opened).
This is still an issue...
Comment #4
swill CreditAttribution: swill commentedBTW, thanks for looking into this. I forgot that part... :)
Comment #5
swill CreditAttribution: swill commentedThis still seems to be an issue. Have you been able to create a Gmap View with data collected with this module?
Cheers,
Will
Comment #6
becw CreditAttribution: becw commentedI think that this is actually an issue with GMap; the latitude and longitude values of Geo point fields show up fine in Views, but when I use the "GMap" view style and set the data source to "choose latitude and longitude fields", the values that appear in the gmap array are (1, 1)--in the ocean right next to Africa.
However, this is *not* an issue when the latitude and longitude are coming from independent decimal fields (not the recommended way to store geodata :) Maybe GMap is not looking at the output values of the Geo field...
Comment #7
swill CreditAttribution: swill commentedIt looks as if this issue has moved from the issue queue of the GMap + Geo Module to the Gmap Module. The issue is that information entered via the Geo / Gmap + Geo module can not be mapped on a Gmap view... I just wanted to clarify because it was not obvious from the title and description anymore...
Comment #8
becw CreditAttribution: becw commentedInformation entered via the GMap + Geo module is stored with Geo--after you enter it, it has no association with the gmap_geo module. GMap + Geo only provides the input widget. The root of the issue is actually getting the GMap module to use the data from the Geo module in a GMap view.
Comment #9
swill CreditAttribution: swill commentedthanks for clarifying that bec. :)
Comment #10
swill CreditAttribution: swill commentedHas there been any movement on this??? I need to get the Geo module working with Gmap Views.
Comment #11
becw CreditAttribution: becw commentedThere hasn't been any movement on this in the past couple days. Lots of things have been changing with Geo, though! Join us on IRC in #drupal-geo sometime (:
Comment #12
swill CreditAttribution: swill commentedHey bec,
I worked with vauxia a bunch tonight and put together a working version of a Gmap for Geo views plugin. I will get in touch with you tomorrow to figure out how we are going to work it in with your code.
Cheers...
Comment #13
becw CreditAttribution: becw commentedcool; I'll be available 9-11am CST tomorrow.
Comment #14
swill CreditAttribution: swill commentedAlright, here it is...
Let me know when you have had a chance to try it.
Cheers
Comment #15
becw CreditAttribution: becw commentedComment #16
swill CreditAttribution: swill commentedIt is worth noting that my patch only works with 'Points' so far...
Comment #17
becw CreditAttribution: becw commentedI started to use your work today but I'm finding that geo_field cck fields are broken with the latest geo commits :(
Comment #18
swill CreditAttribution: swill commentedI will need to update my plugin once these two issues have been resolved in Geo...
http://drupal.org/node/489818
http://drupal.org/node/489988
Comment #19
becw CreditAttribution: becw commentedI've begun to address this in http://drupal.org/cvs?commit=232352
Note that:
* this code requires a patch to Geo at the moment: http://drupal.org/node/505572 -- and it still generates an SQL error (due to the cck field 'multiple' handler needing a set of vids, which the geo_data field handler does not provide).
* I have only tested this code with geo_data fields.
Comment #20
swill CreditAttribution: swill commentedI fixed the views issue (http://drupal.org/node/489988), so now we can complete this views plugin.
What is currently in the Gmap + Geo module needs a minor change in order to function correctly. Here is a patch...
Comment #21
swill CreditAttribution: swill commentedIt turns out that your rewrite of my plugin has removed a lot of the functionality that is important to this plugin.
Things you removed that are important to the plugin:
- Marker selection. We need to be able to select what marker we want the field to display as.
- Popup text. The popup for the marker no longer contains the views information that should be passed.
I am looking to add back these features and I ran into something that I think needs to be fixed. Your 'array_for_gmap' does not support all the options for gmap markers (listed below). I am willing to extend your code and send you a patch, but I would like to make sure that we are on the same page on this. Should I just add the details to your numbered array? It seems wrong to me to have that array be a numbered array and not an associative array.
How should I go about adding back in this functionality? I have no problem just hacking your stuff to my needs, but if I am going to write it for me, I figure I might as well do it as you would like and give it to you.
Cheers,
Will
ps - structure of the marker array...
array(
'options' => array(),
'text' => 'start',
'longitude' => 12.196,
'latitude' => -58.13,
'markername' => 'route',
'offset' => 0,
),
Comment #22
becw CreditAttribution: becw commentedTrue, I did not address that aspect of it yet. I cut out the original config code so that I didn't have to deal with it in the proof-of-concept stage, but I would probably use that as a starting point. If you write something that works in general, that'd be great; I probably won't get to doing anything more elaborate for a few weeks.
Comment #23
swill CreditAttribution: swill commentedAlright, here is what I am currently working with. This patch includes the changes I made in #20.
This may not be the most elegant way to solve this problem, but it is a very simple solution that does not require the rest of the code to change. I basically just checked in gmap_geo_map_feature() to see if the additional information was passed in, and if it was I displayed it. I also updated my views plugin to pass the appropriate information when adding the markers to the map (I am setting 'markername' and 'text' in the views plugin).
This seems to be working for me, so let me know if you have problems or if you think I did something wrong.
Cheers,
Will
Comment #24
Allie MickaI'm just going to tack this on here because it's affected by this discussion. With the latest version of geo, the $field is broken into an array ( to more closely resemble what it looks like to CCK formatters)
The takeaway is that you want to access wkb:
(you don't need to find the base and or append the _wkb) Thus the above code replaces the following:
$base_field = substr($field, 0, -4); // Edit by swill: this is because the $field variable ends with _geo, but we want to use the _wkb field...
$geo_array = geo_wkb_get_data($r->{$base_field.'_wkb'}, 'array_for_gmap');