I have been struggling with gmap and location module. I have a custom node type called user_info which integrates with location module i.e it lets you to enter street name, city, country etc. and to choose latitude and longitude from google map.
In the node full view i could see the input street name, city, country and latitude and latitude generated from google map but no google map been displayed here.
After searching on google i came to know that i am suppose to generate gmap marco from "map/macro" url ( which looks something like [gmap zoom=12 |center=32.82421110161336, -96.77650451660156 |width=500px |height=400px |control=Small |type=Map]) and enter it in node body field. is it the way it works ? is it not possible to automatically map from location field input and display it in node view ?
sivaji j.g wrote:
is it not possible to automatically map from location field input and display it in node view ?
Here is a possibly method: Use Views and create a GMap type view with an arguement that is the Node: nid Use Views Attach to attach your view to the node type.
One of the benefits of this method is you can do cool things like show the 5 closest users, etc.
HTH
The location map can be displayed in node view as a block called "location map". You have to asign the block under admin/build/block/list/your_theme to the region where you want it displayed.
I think, there's also a module to display the block directly within the node, a sort of panel (but I can't find it at the moment).
John Thomas schrieb:
sivaji j.g wrote:
is it not possible to automatically map from location field input and display it in node view ?
Here is a possibly method: Use Views and create a GMap type view with an arguement that is the Node: nid Use Views Attach to attach your view to the node type.
One of the benefits of this method is you can do cool things like show the 5 closest users, etc.
HTH
I do this on some old 5.x app: It can't be too different for 6.x
<?php /* * id - the id of the map every map on a page must have a unique id * width - width of the map * height - height of the map * center - a string of the longitude and latitude of the centre of the map * zoom - the zoom factor of the google map * align - the alignment of the map 'right', 'left' or 'center' * control - the control shown on the map 'Large', 'Small', or 'None' * type - 'Map', 'Hybrid' or 'Satellite' * points/markers - a string of points to mark on the map with + between each point */ $points = array( 'id' => 'map'.$node->nid, 'width' => '500px', 'height' => '250px', 'latitude' => $location['latitude'], 'longitude'=> $location['longitude'], 'zoom' => 14, 'maptype' => 'Map', 'markers' => array(array( 'markername' => 'orange', 'latitude' => $location['latitude'], 'longitude' => $location['longitude'] )) ); print theme('gmap', array('#settings' => $points)); ?> </div> <?php } ?>
Best Pavan Keshavamurthy
You could code this into your node template or perhaps use contemplate. On Thursday 11 June 2009 14:40:38 sivaji j.g wrote:
I have been struggling with gmap and location module. I have a custom node type called user_info which integrates with location module i.e it lets you to enter street name, city, country etc. and to choose latitude and longitude from google map.
In the node full view i could see the input street name, city, country and latitude and latitude generated from google map but no google map been displayed here.
After searching on google i came to know that i am suppose to generate gmap marco from "map/macro" url ( which looks something like [gmap zoom=12 |center=32.82421110161336, -96.77650451660156 |width=500px
|height=400px |control=Small |type=Map]) and enter it in node body
field. is it the way it works ? is it not possible to automatically map from location field input and display it in node view ?