Welcome, Guest
Username: Password: Remember me

TOPIC: Marker data in google maps

Marker data in google maps 07 Aug 2016 15:42 #14367

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
I am using your code for a list of markers in a map.. here is my version (api removed)
<div>
        <?php echo JDom::_('html.fly.map.google', array(

            'keyAPI' => 'xxxxx',

            'markers' => array(

                'fitBounds' => true,

                // Set the markers datas from a list
                'list' => $this->items,

                'dataKeys' => array(
                    'lat' => 'lat',
                    'lng' => 'lng',

                    // Search by name, or address, when the coordinate are missing or empty
                    'address' => '{name} {postcode}',

                    // Set the marker title
                    'title' => '{name}',

                    // Template Description
                    'content' => '<span style="font-size:16px;">{summary}</span>'
                ),
            ),

        )); ?>
    </div>

The markers are all showing correctly (so model is pulling data) , but the content in {name} etc are just blank
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Marker data in google maps 07 Aug 2016 16:25 #14369

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Did you included 'name' in the SELECT of your query ?
Because this is not automatic. JDom can only use the values, but does not create the SQL according to its needs such as an ORM.
Coding is now a piece of cake
The administrator has disabled public write access.

Marker data in google maps 07 Aug 2016 16:35 #14373

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Ah found it

I did have a.summary missing in the model.. now added and content is OK

Also, if I put {name} in the content it renders.. it looks like the TITLE part of the JDOM is not rendering i.e
// Set the marker title
                    'title' => '{name}',

is empty when I render content. I dont think you use it in your example as you create a layout for your box
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Marker data in google maps 09 Aug 2016 11:09 #14403

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
What do you mean ?
It works for me.

'title', 'content', 'address' are parsing the {tags} without problem.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.080 seconds

Get Started