Google map from custom page attribute 5.6.2.1

Permalink
I need to have a google map at the bottom of a page that is dynamically created via Dashboard Page Manager. I currently have a map that is generated through the page_list block. It works ok except for the fact that no matter what I do, I cannot change the zoom level. It is zoomed in all the way.

Is there a better way for me to do this?

I have an ADDRESS, CITY, STATE and ZIP attribute. I am not converting to lat/long at all. Below is the code from the view.php in map_view pagelist template.

<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
?>
<?php
$addresses = array();
foreach ($pages as $page):
    // Prepare data for each page being listed...
    $title = $th->entities($page->getCollectionName());
    $url = $nh->getLinkToCollection($page);
    $address = $page->getAttribute('street_address') . ' ' . $page->getAttribute('city') . ' ' . $page->getAttribute('state');
    $position = 'address:'. json_encode($address);
    $addresses[] = '{'.$position .', data:'.json_encode($url). '}';
endforeach; ?>
<?php

View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
aaronmarp replied on at Permalink Reply
Hi JohnTheFish, thanks for the link but I must be missing something here. That will work great if I just needed to insert a map. I do not see how I can use that to utilize my page atttribute for the address. Can you please elaborate?

Thank you
JohntheFish replied on at Permalink Reply
JohntheFish
The addon lists pages and uses page attributes to mark the map.

It may be the most you would need to do is a custom block view to add the address attribute into the tip. I think the docs say something about custom tips.