13

See new documentation page for geofield that shows how to setup a basic proximity search (it is based on MotoTribe's answer, but with a bit more info) As requested, some of the link content: Instructions Required modules You must download the latest modules. These instructions have been tested with the 'dev' versions of geocoder, geofield, and ...


8

Looks pretty straightforward using geofield 7.x-2.0-alpha2: I assume you have geofield and geophp enabled and assume you have added a geofield to your users that get the location from an addressfield. create a view of type users add "[name of your geofield] - proximity" field select "source of origin", I tried "exposed geofield ...


6

You can also use the #access check to keep people from seeing the vertical tabs. $form['additional_settings']['#access'] = FALSE; Simply add that to a hook form alter or in between the loading and the rendering of a form. After that you can call render($form) to get the markup.


5

Not to put a damper on things (I've written more scrapers than I care to remember and it's always fun), but such an act is specifically against Google's Terms of Service: Do not misuse our Services, for example, do not interfere with our Services or try to access them using a method other than the interface and the instructions that we provide. I'm sure ...


5

And the answer: $entity_metadata_wrapper = entity_metadata_wrapper('node', $node_object); $data = array( 'lat' => 44, 'lon' => -93 ); $entity_metadata_wrapper->field_position->set($data);


4

I have been able to accomplish this task following these steps: Installed modules for search: search_api, search_api_location, search_api_solr search_api_views, search_api_facetapi, Search API location views Installed modules for "geosearch": geofield (to store lat, lon...), addressfield (make it easier for users to enter an address and don't worry about ...


4

According to README.TXT: API NOTES Geofield fields contain nine columns of information about the geographic > data that is stores. At its heart is the 'wkt' column where it stores the full geometry in the 'Well Known Text' (WKT) format. All other columns are metadata derived from the WKT column. Columns are as follows: 'geom' Raw ...


4

hook_boot() is invoked too early to use the session, as Drupal has not yet initialised the session. Furthermore, hook_boot() has been removed from Drupal 8. hook_init() is not invoked for cached pages, but there is a trick to avoid the page is cached: Call drupal_page_is_cacheable(FALSE) in hook_init(). The function that actually stores the current page in ...


4

Your problem is that views uses SQL to sort, since that is a lot easier and faster and it otherwise would be required to load all the records and sort them with PHP, before selecting which to show, which is a massive resources waste if you have a lot of records and use paging. A simple solution to this problem, is to create a work around. Since the country ...


4

MotoTribe's answer is basically correct, but you might want to use the dev release instead of the alpha release. We've had a few bug fixes in since then. We should probably do a new release soon. Source: Geofield maintainer.


4

Location: provides the Location API; handles address storage and geocoding. Essentially the base of the location module to which the other modules rely upon. Location CCK: provide a Location behavior as a CCK field. This module uses the field API properly rather than its legacy node location module which implemented its own fields and storage. If you are ...


4

I have created a working sandbox version of address autocomplete. https://drupal.org/sandbox/adammitchell/2126989. I will endeavour to get it created into a full blown project. However if you could help me and test it that would be greatly appreciated.


4

Set Geofield using EntityMetadataWrapper if you only have the Longitude & Latitude information. (2015): $geofield_data = geofield_compute_values(array( 'lat' => [Latitude], 'lon' => [Longitude] ), GEOFIELD_INPUT_LAT_LON); $entity_metadata_wrapper->field_position->set($geofield_data); When a geofield is saved using ...


4

I had a similar issue with editing the exposed form. Form alter is not the right way to go though. You'll need to use element info alter. Take a look at this custom module I threw together for editing the geofield proximity search. You can see what I did, and add/modify functionalities for your needs (although I think i did exactly what you wanted).


4

If you have an array of nids you could just run this piece of code example will unpublish the nodes with nid 1,2,3: $nids = array(1, 2 ,3); foreach($nids as $nid) { db_query("UPDATE {node} SET `status` = '0' WHERE `nid` =:nid ;" ,array(':nid'=> $nid)); } entity_get_controller('node')->resetCache($nids);


3

I had a good experience with Geolocation Field. I used this module on dealing website to show location of store. It lets you mark location via node creation/edition form and have display formatter to rendering the address as PNG or Google map. It was simple and good enough.


3

With the first solution, the country key is missing, so you can't save this country field because the country key doesn't match. I suggest that (similar to the second solution) : function hook_countries_alter(&$countries) { $country_key = 'FR';//eg. your country key $country_data = $countries[$country_key]; unset($countries[$country_key]); $...


3

Results may vary based upon your drupal version, but basically when you create a proximity filter: the first option is "Node location" but when you click on that: it will allow you to use a Location CCK field as well.


3

This works, but (here's the trick), only if you enable the location_entity module, which ships with location. $location = array( 'latitude' => $latitude, 'street' => $street, // etc, other elements added here ... ); $ew->field_location->set($location); $ew->save(); May no one else lose as much time on this ever again.


3

Perhaps something as follows? i did not try the code below it is based on something I am working on (see : http://drupal.org/node/1956690 ) .. I am trying to autofill options of a 'selectbox'. Which is working .. And since you are great with javascript :) How do I prevent prevent the 'enter key on a form' ? :) (see : http://drupal.org/node/370694 ) (edit: I ...


3

Geolocation Proximity seems to be exactly a solution for you. You will need to keep location data using Geolocation Field to benefit from it. Current features are: Views filter that can be used to filter entities (nodes, users, etc.) based on distance from a certain point (defined as lat/lng point). The input widget is very basic at the moment. ...


3

In short : Use the Location Distance field in Views. In detail : Check out the video http://www.youtube.com/watch?v=AxeskzN8BAc


3

You will need custom coding to provide the argument to the view, but you could use the following modules for the geolocation functionality: Feature-rich, server-side solution: Smart IP Simpler, ip-based server/client-side solution: geoPlugin


3

Nigel Waters has it correct. Here are the details. I did this for cities and states. I used points for cities and polygons for states. Here are the steps. Requirements: Geofield module Leaflet module Leaflet Views module (a submodule of Leaflet) Steps: Create the two content types: City and State. Create a field of type Geofield, call it "Location" ...


3

Yes, it's possible to have 2 different views on the same page sharing the same exposed filter query parameters. The trouble you're having is, by default, a block display doesn't show any exposed filters. The only way to enable this is by enabling the Use AJAX setting on the block view under the Advanced section in the admin UI. Once set, both the block &...


3

You get the infinite loop, because the country name is a translatable markup and print_r() can't handle this object. If you cast the country name to a string, then it is printable in php: $countries = \Drupal\Core\Locale\CountryManager::getStandardList(); foreach ($countries as $key => $value) { $country_name = (string) $value; print "$key - $...


2

I wrote a simple possible solution in the already mentioned thread: https://drupal.org/node/1048644#comment-7822687. For convenience, I'll paste it here. There's a simple way to disable vertical tabs on a form, by simply changing the $form['additional_settings']['#type'] variable's value to 'fieldset' in an implementation of hook_form_alter() or ...


2

Using values like this, I was able to update a geofield's data programatically: PHP $lat = 42.281646; $lon = -83.744222; $geofield = array( 'geom' => "POINT ($lon $lat)", 'geo_type' => 'point', 'lat' => $lat . "000000", 'lon' => $lon . "000000", 'left' => $lon . "000000", 'top' => $lat . "000000", 'right' => $lon . "...


2

I can confirm that it is possible to get locations and GMAP running on Drupal 6 for Canadian addresses. I have done this on more than one occasion. From your description it simply sounds some setting preventing the reverse geocoding of addresses. Edit one of your nodes with canadian addresses and confirm that the Lat and Lon field are empty. Save then ...


2

We had the same requirement in a recent project. It was solved with javascript, there is no out of the box way to do this. Please see https://www.transpower.co.nz/projects Here is some code to get you started: (function ($, Drupal, window, document, undefined) { // ... $(function(){ if($(".not-front .openlayers-map").length && !$('.node-...


Only top voted, non community-wiki answers of a minimum length are eligible