So, swing-turn. For GMAP to work properly, we’ll need to get the Google Maps API Key from Google . The deal is free and fast. The resulting key is entered in the GMAP settings, then we set the settings for the card.
Then we will have to configure the Location module (it is the Location ... it was looking for a long time) 
Above, I indicated that for each entry there can be only one address, I set the city and country by default. It remains quite a bit: create a map where all the objects will be shown and display the map on the page of the object itself. Output the shared map via the View:
The main thing here - Style: Gmap. Well, the list of fields with the filter ... Now it remains to show the map on the page of the office itself. Here it is necessary to get into the code a little. So, in the template for this type of materials I added the following construction: <?php print gmap_simple_map($node->locations[0]['latitude'], $node->locations[0]['longitude'], '', '<strong>'.$node->locations[0]['name'].'</strong><br/>'.$node->locations[0]['street'], 15, '650px', '400px', FALSE,''); ?> <?php print gmap_simple_map($node->locations[0]['latitude'], $node->locations[0]['longitude'], '', '<strong>'.$node->locations[0]['name'].'</strong><br/>'.$node->locations[0]['street'], 15, '650px', '400px', FALSE,''); ?> Ie I draw a map of 650x400 pixels, show a marker on it, in the description window I write the name of the node and the address. That is, in fact, everything ... Let's try it in action? Add a record and put down the location there:
Let's see what the map looks like on the object page:
This is the page with the list of objects. So far, there are only 2 of them, so not too impressive:
However, it is possible to show, say, the list of gift shops in St. Petersburg or the location of the lion statues in St. Petersburg : 
Source: https://habr.com/ru/post/56505/
All Articles