Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am building a restaurant application which would have a search functionality, and when somebody searches of restaurants for a zip code, it would return the data. The data would be the name of the restaurant, the description and the map. When a user is adding the restaurant, I am using address field and geofield to get the latitude and longitude, so getting the maps up and running isn't an issue now.

However, I trying to create the search view, but I am unable to create a view which has a path, and which would display the title, description and then the map.

ex: Title | Description
    MAP1(map for first restaurant)

    Title | Description
    MAP2

Can somebody tell me how would I build it?

The modules I am using to build this are geofield, geophp, geocoder, addressfield, openlayers, views, ctools and libraries.

share|improve this question

3 Answers 3

up vote 3 down vote accepted
+50

You can add the map into a view in simple way. Enable the "geofield map" module .Create a view . you can add a field(geofield) and in the settings you can give the "Formatter" as geofield map. You can also add the other fields you needed from that node .. enter image description here

share|improve this answer

step 1 :Enable the "geofield map" module in the geofield module pack. Than create a view with the geofield (latitude and longitude) fields with a contextual filter node id. In the view you can set the "Format" as geofield map(see attachment). . You can also do with the help of "location" module. Now you have a view of map. enter image description here

step 2: Enable the views_field_view module . Create another view for the restaurant details. For viewing the map, you can select "Global :view" in the field. There you can select which view you should have to embed in that field and you can give the arguments there(here 'nid') in the field settings(see attachment). enter image description here

share|improve this answer

Please check the views_field_view and it may helps you

You can first create a view for the map with a argument as node->nid. Then create another view for your restaurant. In the second view you can embed the first view(for map) with views_field_view module as a field

share|improve this answer
    
Hi Praveen, what module would I use for the map? Is there a tutorial that I could follow for this. I am getting the location using the addressfield, geofield, and geophp modules. –  macha Nov 12 '12 at 22:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.