gProximity Views?

faulkner161 - August 11, 2008 - 13:23
Project:gProximity
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:faulkner161
Status:postponed (maintainer needs more info)
Description

I have installed this module, GCG, views, Location, GMap, GMap Lat/Lon and I totally miffed. I am working on trying to create a google map which allows the user to select a nearest dojo (martial arts training ground) that is closest to them. I have set up location and used the locative fields in one content type. I was able to successfully view all of these nodes as a google map using views.

I then downloaded and installed your module. This is on my own machine and the Googlemap API keys are set for localhost (shouldn't be a problem, as this is only the developmental stage of my project). I can create a view, whereby I setup fields for latitude, longitude, title and distance. The view is required to display gProximity: Google Map locations, with no nodes per page. I then added the filters for Location proximity and made it into an exposed filter. In addition the content type was added. I am then prompted to make a gProximity view. I select the view that I have created, this is ok. I have entered the latitude and the longitude to centre the map view both using the geocoding and manually tyoing them in. This is for the UK. Don't know if that makes any difference. I then choose a map icon for the drag down selection box, usually drupal; but I have tried others. After that I click save, but I get the error message: Latitude field is required, longitude field is require, map icon field is required. I am unable to get past this error to even see the view I have created.

I have also tried using the gcg module, which is better than the location module, as it nicely displays a miniature googlemap on the node created. I created another view and selected the gcg latitude and longitude fields in the view, keeping everything else the same as before. I still get the same error message as before.

Please help me. I am wracking my brains for the solution to this problem and this is critical to the overall success of m site.

Many Thanks,

Simon.

#1

faulkner161 - August 11, 2008 - 13:24
Title:Hello» gProximity Views?

#2

greenSkin - August 11, 2008 - 15:39
Status:active» postponed (maintainer needs more info)

Which lat/long fields are causing the error. There are the ones for setting the initial center of the map and there are the ones where you designate which fields from the view are lat/long? Also, if you have Firebug installed check the console pane and see if it is returning any errors.

#3

faulkner161 - August 11, 2008 - 16:20

I don't have firebug installed, but am looking into this now. In the meanwhile, it appears to be the ones for setting the initial center of the map. I am looking into firebug now!

#4

faulkner161 - August 11, 2008 - 16:44

OK, what a great program, the error appears as this and it happens when I go into the add gProximity view:

gproximity.js (line 102): $("add_fields")[0] is undefined
$("add_fields")[0].selectedIndex=0;

I don't know if that helps you with elucidating this problem. Is there a module that I need to install. I have the following modules installed:

Location generate 5.x3.0_test 1
GCG = 5.x -01
Country Codes API 5.x 1.0
GMap Lat/Lon 5.x-01
gProximity 5.x-1.x-dev
Token 5.x1.11
GMap 5.x1.0-beta 3
Location 5.x.3.0-test1
keysAPI 5.x-1.1

I set up in keys two API codes, one which I registered the service to GMaps, the other to gProximity.

Other than that, that's all of the information I can give at this time.

Many thanks for your help,

Simon.

#5

greenSkin - August 11, 2008 - 17:03

Those two lines should read at line 102:

$("#add_fields")[0].selectedIndex = 0;

Notice the '#' sign in front of the 'add_fields'.

#6

greenSkin - August 11, 2008 - 17:05

Also, take a look in the console window for a line that reads something like 'POST admin/build/gproximity/get_view', open this and tell me what the response is.

#7

faulkner161 - August 11, 2008 - 17:16

It reads as being empty. I am off to karate now and won't be back until 10:00 pm (UK time). I hope that helps...?

#8

faulkner161 - August 11, 2008 - 17:18

The response reads as empty. Do you need the other tab information?

#9

greenSkin - August 11, 2008 - 17:20

Nope, I don't need the other tab information. Try changing the view type for the view to list or table or something and make sure that the view is returning information.

#10

faulkner161 - August 11, 2008 - 17:24

yes it's returning the lon/lat coordinates... in a table view

#11

faulkner161 - August 11, 2008 - 23:27

Right,

I've done some tests. I am using firefox on my localhost virtual machine on a linux operating system (ubuntu). I am also able to use internet explorer on my local machine by referencing it to the ip address of the virtual machine. I made two more googlemaps API keys for gProximity and GMaps. I tested that the views worked as a table on my virtual machine. This is fine. It pulls that data out, as expected.

I then decided to use Internet explorer and create a gProximity view. This appeared to work. Really confused, but I had the proximity filter on and the gProximity view has it's own address field to complete. Which one do I use? In addition, it only came up with one result, where I have provided lat/lon for at least 17 locations and double checked them to make sure that they are accurate! I am so confused!!!

#12

greenSkin - August 11, 2008 - 23:37

For gProximity to work as intended you will need to set the View to pull all nodes with no paging and no exposed filtering. When I was writing the gProximity module initially, I had decided it would be best to initially load all the nodes as markers thus improving the search speed, this also provides the ability to have clusters.

#13

faulkner161 - August 12, 2008 - 00:11

I have set the view up now... How do I link the nodes in a certain search area to go that node. It's not showing up the view in a way I anticipated. The google map for instance only ever has one marker on it. This is weird, seeing as there are more than 2-3 nodes within this search distance... i'm confused...

#14

faulkner161 - August 12, 2008 - 15:17

I have a number of questions now. I have managed to link the node title to the correct node.
1. When using the gproximity view to search with, how is it geocoding. Do you need the full address for improved accuracy, as it doesn't seem particularly accurate with postcode alone.

In addition, when I move the map, all of the locations change around, giving new distances. It also only shows one marker on the map, instead of displayin the ones that are within the set range.

2. Am I supposed to use the proximity filter, even though there appears to be a search facility available on the gproximity view. I have changed this to not be exposed, but I think it is a little redundant. Ideally, what I am looking for has been achieved in a module outside drupal site. It is called phpGoogleStoreLocator on crystaldawn.net.

This is very close to what you have, it provides a google map, but it allows you to geocode the starting point which for UK users is a godsend as postal code information is not free. It then displays this as a marker on the map and gives you the option to choose a search radius and category (which could almost be a taxonomy term). By doing this, you can view both the map and the results table. The only difference is, this module isn't very well incorporated into drupals UI and work is underway to make it more drupalised. However, if I can get this to work before that, I would like to stick with this solution, as it also could work with google client geocoder.

Please help me to make this a success, or point me in the right direction. I have really appreciated your help thus far,

Simon.

#15

greenSkin - August 12, 2008 - 16:39

1. The gProximity module uses Google to do the geocoding from the search. I would say you do need a full address for improved accuracy, but Google is smart enough to determine an accurate result.

What zoom level are you at when only one marker is showing?

2. No, do not use the proximity filter during setup of the View. What you want to do when setting up your view is to basically grab every node you want gProximity to have access to, that means only setting the appropriate filters to select all the nodes that will be markers for the Google map.

I hope I answered your questions.

#16

greenSkin - August 12, 2008 - 17:19

Also, should note to make sure all the nodes passed to gProximity have latitude and longitude values. Easy way to check is to either clone your view (or use your current gProximity view) and change the view type to table with your latitude and longitude fields sortable, then view the page and sort either your latitude or longitude fields looking for blanks or 0's.

#17

faulkner161 - August 12, 2008 - 23:00

OK, so I have done as suggested and created a clone of my view. All of the lats and lons are valid and I am filtering to include all of the nodes of dojo_type. The table displayed all of the results as anticipated, with no 0 entries. What I have decided to do is send you a copy of my view and everything I set up in it and the subsequent gProx locator view.

The view has the following settings:
Page
Provide page view = yes
url = nhnh (it's a test) ;)
use pager = no
Breadcrumb trail should not include "Home" = no
Nodes per page = 0

Nothing for header, footer, empty text, menu settings
Nothing for block

Fields
Node: Title Normal As link No None
Display the title of the node.
Location: Name No None
Location: Street No None
Location: Postal Code No None
Location: Latitude No None
Location: Longitude No None

There no arguments;

Filters
Node: Type Is One Of Dojo

No exposed filters.
No Sort criteria
No Meta Tags

The for the gProximity View, the following settings are chosen:
Height = 550 px, width (500 px)

Page Layout
Map Results
Title: Results from gProximity View
Use Pager = NO
Distance Limit = 15
width = 0, height = 0
Node title link opens marker info window = NO

Initial Zoom Level = 11
Search Zoom Level = 11

Map Center
Lat = 51.403489
Lon = 0.093384

Map controls>
default, all = off and zoom control (small, zoom in and out; pan in four directions)

Markers
Zoom Out level = 0
Zoom In level = No Limit
Icon : purple.png

Lat and Lon
Lat = Latitude
Lon = Longitude

Info Format:
[node_title]
[location_name]
[location_street]
[location_postal_code]
Distance from address given [DISTANCE-MILES]

There are no clusters.

A lot of info there, sorry. But if I give you everything, then I haven't left any detail out. Yes, still only one dojo is displayed at this level of zoom. Interstingly, by clicking on the map and zooming in at different places, you can generate results, but it is not clear from where, as there is no visible marker on the map. In addition, one or two more markers appear by changing the level of zoom and position of the cursor. This problem is so close to being solved. I just need to sort out the last part and display the map on the center of the page with the relevant information displayed underneath. At the moment, I would request that the users location is displayed as a marker (maybe saying you), so that it is possible to see where the results start point is on the map and adjust it accordingly.

#18

muhleder - August 13, 2008 - 17:02

I can add a little bit of detail about the Google geocoding for the UK here, or at least the way it worked when I set up my implementation a couple of months ago. Google will(or did) provide accurate geocoding if you entered a street address and town for example, but as soon as you included the postcode it went vague, (using just the first part of the postcode, eg SW1).

The Location module looks like it's coming along really nicely so I guess you could let users fine-tune their location using the Location map per page?

I do love this module though, going to be going through all the stuff above quite soon as I had some similar issues about the way it worked.

#19

faulkner161 - August 13, 2008 - 17:57

Sorry, not sure i know what u mean??? Does location have it's own map, or are you talking about using it with gMap. If so, I kinda want the same functionality given by gProximity, just I need to have a formatted table below that has clickable links. In the future, I am looking to add fields to allow users to have an advanced search. I.e. seeing the nearest location ona certain day of the week.

#20

muhleder - August 13, 2008 - 22:00

I just installed the latest version quickly, so I'm a bit hazy on the details, but Location gives you options to enter address details on enabled content types. You can also can set each content type to have a google map (provided by Gmap?) which you can use on the node edit page to set the position precisely, overriding the vague geolocation from the address.

Once the Location latitude and longitude is set (either by geocoding from a address/postcode, or the map on the edit node page), gproximity can be set to use that data to position the markers.

I'm not sure how stable/mature the latest version of Location is as it was only released recently, but it looks good and there seems to be a lot of work going into the project. Might be worth looking at if you're not under a tight deadline.

#21

faulkner161 - August 13, 2008 - 22:47

OK, so I did that by changing tactic slightly. I used GCG module which allows you to set up makers as detailed on a small map. I have also entered the coordinates in location.lat and location.lon fields, but I have decided to use this module now over location, as it allows you to set a small google map on node, which is pretty cool. In addition, the lat and lon fields from gcg can also be given to gproximity. I am still experiencing the same problem though. It seems to accept the address I enter in my search, but I am only ever seeing one marker. That is, unless I start changing the zoom and position of the center of the map. This seems to generate results, but there is no way of saying where the starting point is for these results. I am now awaiting the release of phpGoogleStoreLocatore, which was on crystaldawn.net, as this is the only one which gives the functionality and the results in a format that I need to use. This is a shame really, as the work on locations seems fantastic, but it's missing the one detail I need; the ability to display the results in a way that is user friendly.
Guess I am going to have to hold out until october.

#22

jmary - September 4, 2008 - 11:51

That's an idea but what about the page size if there are thousands of nodes ? Is that could be an option ?

I need the gproximity functions badly but :

I don't need the map, just some fields of the nodes which are in a given radius from a precise address. And I want those fields to be displayed in a table, with some of them sortable.

It seems I have to start from your module and proceed heavy customization (rewrite it) to obtain this.

I actually don't know what would be most easy : using the location API or rewrite some parts of your work. If you have a precise idea on this I'd be happy to know it.

 
 

Drupal is a registered trademark of Dries Buytaert.