
Display nodes on Google Maps
Suppose that we have a fairly simple task - to show on the map the location of objects (nodes, users). For example, offices , or, say, gift shops . Those. we should get a page where a map with the location of all objects of a given type is displayed, and show a map on the page of each individual object. It will be about the 6th version of Drupal , but in 5-ke everything is the same (to be honest, the screen at the end was taken from Drupal 5). To accomplish this task I will use the following modules: GMAP , Location , Views (on the site I also use CCK & Contemplate, but they are so auxiliary in this task that it’s not worth talking about them).
So, swing-turn on. For GMAP to work properly, we need to get Google Maps API Key from Google . The case is free and fast. We enter the received key in the GMAP settings, then set the settings for the card.
Next, we will have to configure the Location module (it’s also called Location… looking for a long time). 
The main thing that should concern us here is the country and the “Use a Google Map to set latitude and longitude” checkbox. Well, now let us use geolocation for our materials. So, I already have the type of material "Office", the entries in which I will display on the map:
Above, I pointed out that for each entry there can be only one address, set the city and country by default. There is very little left: create a map where all the objects will be displayed and display the map on the page of the object itself. We output the general map through View:
The main thing here is Style: Gmap. Well, a list of fields with a filter ... Now it remains to show the map on the page of the office itself. Here you have to get into the code a little. So, in the template for this type of material, I added the following design: i.e. I display a card with a size of 650x400 pixels, I show a marker on it, in the window with a description I write the name of the node and the address. That, in fact, is all ... Let's try in action? Add a record and put down the location there: Let's see how the map looks on the object’s page:

And here is a page with a list of objects. So far, however, there are only 2 of them, so it’s not too impressive:
However, you can show, say, a list of gift shops in St. Petersburg or the location of lion statues in St. Petersburg :



The main thing that should concern us here is the country and the “Use a Google Map to set latitude and longitude” checkbox. Well, now let us use geolocation for our materials. So, I already have the type of material "Office", the entries in which I will display on the map:


locations[0]['latitude'], $node->locations[0]['longitude'], '', ''.$node->locations[0]['name'].'
'.$node->locations[0]['street'], 15, '650px', '400px', FALSE,''); ?>



