I am using the gmap and location modules to display a map. I would like the users to be able to fill an address in a field and the map autocenters and autozooms to that address. Like maps.google.com does it.
Is there a module or any specific configuration I can do with drupal? Ultimately I would like to create an advance filter where user inputs country, province and address and posibly select from a drop down list. Something very similar to what it is done in the following link http://www.dei.gr/Default.aspx?id=30608&nt=18&lang=2&langid=1
Thanks.
The GMap Location Module is the one which fits the requirements most closely.
"Provides a map of all a site's nodes and a map of all of the site users."
If you'd like to create it by yourself:
Would suggest to create 2 tables - with labels and center-points - in order to populate these cascaded drop-downs.
The last input-box needs to geo-code the entered text - over the Google GeoCoder API.
Of course any centerpoint could be geo-coded - but you have a limit of 2.500 API requests per 24hrs on the PHP API,
unless being a premier customer (besides local results are just quicker). That's why it's recommend to store the center-points for each item in the drop-downs in a table - and only use the JS API (instead of the PHP API) for the last step.
The example which you provided reloads the whole page when changing the drop-downs, which should be avoided.
Related
I've seen some website, once you on the front page, it automatically populate the search field with your location. I want to implement the same thing for my directory site. One field, is for whatever they want to search for, and the second field is a location field for the user to enter the city or postcode they want to search on.
I want to pre-populate the location field, automatically once the user landed on front page. Any modules that I can use for this?
It will depend on which search engine/backend you use. Using Solr, you can use the Geolocation Field module in conjunction with Search API Location.
The Search API Location module adds the possibility of location based searching to the Search API module (currently only Apache Solr is supported as the service class).
Geolocation Field provides a field type to store geographical locations as pairs of latitude and longitude (lan,lng) as well as the necessary integration to display those locations through views, fields and using a number of different map providers.
Once configured, you will be able to pre-populate the location field by hooking into your search form using hook_form_alter.
Facet Filter Demo
I'm creating a search page with Elastic search + Symfony2 using FOSElastica. I have setup repository and model transform and pagination perfectly fine.
I have geo-location search with couple of aggregation which are following
Distance Range
< 5 miles
25 miles
50 miles
100 miles
Duration between two points
30 minutes
1 hour
2 hour
3 hour
Categories
Car
Truck
Bike
Hover board
location: geo point (default is set by country)
Question
There will be multiple aggregation click by user to filter their data to narrow the data. What would be the best way to track which aggregation is active by the user?
And how can I show send and receive filter aggregation between controller and service methods?
Would it be best to just track everything by session?
Since the default Elasticsearch response doc does not contain the query that was submitted, you'll need to keep track of the filter selection state in a MVC application in order to properly render your filter controls.
Some options:
filters encoded into form elements (possibly hidden) on the page. Form could post via Ajax.
filters encoded into url (added benefit of bookmarkable/shareable searches)
filters stored in session (not sure why you'd want this, but it would be possible)
Once you've submitted a search request, your controller which calls Elasticsearch, is now responsible for passing the user's filter selection state to Elastica (and also back to the view along with search results)
This sort of echoing filter state back from the search controller is useful especially when you need to redraw the section of the page housing search filters.
I am using App Inventor 2 from MIT.
I have a fusion table with location column of type location. Using the FusiontableControls component I am able to write into the table and view the table using the WebViewer component, I am able to view the URL of the Table and the data is there.
However, when I use the URL from the Map view of the table, I see the map display on my app but without the locations in the table marked. However, if I go to the web address of the fusion table on a web browser on a pc, hit the location button, the map updates with the location information and next time I use the app, the map shows with the locations marked.
Is there a way to display the updated map using App Inventor without having to go manually and update the map page?
Update 1: As #Taifun suggested, I tried clear cache. It doesn't work.
Update 2: Further investigations show that by default, location info in FusionTable is not geocoded and that is why map doesn't show it. The question now is whether there is an API that forces geocoding when I insert the location info into the fusion table using app inventor 2?
Update 3: Taifun's suggestion worked. Storing address as lat,long makes the map automatically geocode and display locations. Earlier I was using the address returned from location sensor which returns something like 123 Main St, city,st 12345. Even though it is a valid address, it doesn't auto geocode.
Thanks a lot Taifun. (also for editing my post for clarity)
Define your location as one column location like this
instead of using two separate columns (lat and long) in your table. This should update your map automatically. See also https://support.google.com/fusiontables/answer/1012281?hl=en
I have a website (bootleg/css) I put together. I am currently implementing user registration but I am having troubles determining the best way to go about the following:
I have users that will be entering their teammates, and themselves into a tournament (via a form). That's the easy part. Once the users have input their info, I'd like the webpage to populate with the registered team in a designated area. The structure as so:
(Registration form)
TEAM NAME
Member 1
Member 2
Member 3
Member 4
I want it to take TEAM NAME and display it in a specific section of a webpage for those registered. Like so:
(Displayed as so)
REGISTERED TEAMS:
Slayers
Dominatrix
Evolution
I am most familiar with css and html, but I am willing to work with php as long as it can be injected into the current site. I have a MySQL server setup and can edit it further. I've done a LOT on the design side, but not too much on the scripting side until recently so go easy on me.
You can do this by simply using PHP and MySQL.As you said,you are familiar with MySQL,I would give you the outline to do this.
Make a table for the registered users,Insert data to MySQL Database using INSERT Query in MySQL.
INSERT INTO Table_name (id,member_name,member_age,...) VALUE ('','$name','$age',...)
You can select all the values using SELECT Query from Database Table,and echo it on HTML part,where you want to show the result.
SELECT * FROM Table_name
I have one Drupal website where there is a list of all temples, mosques, church etc available. Now i want a search form in my front page where user can search temples, mosques, church etc. I am using View exposed filter for searching results. But problem is when i go to add filter criteria then It ask for specific CCK field to exposed.
In Drupal machine name is always unique. So for temples it takes different machine name and for mosques it takes different.
I want only one search form where user can search all temples, mosques etc. Right now i am using different search form for different one. How can i do this with only one search form???
One more thing I am using these modules for handling addresses and locations
Address Field - 7.x-1.0-beta3
Geofield - 7.x-1.1
GeoPHP - 7.x-1.6
Geocoder - 7.x-1.2
How can i search results based on city and locations?
Assuming that you want to make the searches by name, then you should use the same field for all the temples' names, regardless of their type. By doing that exposing that field will do what you want.