Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle map doesn't load using codeigniter with googlemaps v3 library when I use an object property in the infowindow_content
    text
    copied!<p>I have made a site with codeigniter and am using the <a href="http://biostall.com/codeigniter-google-maps-v3-api-library" rel="nofollow">googlemaps v3 library</a> to add markers to a map. I get the locations from my database as an array of objects, which I then loop through in a foreach adding the location to the map each time. If i enter a string as the infowindow_content everything is fine and the info bubble pops up with the string in when a marker is clicked. When I use a property of the location object though the map doesn't load.</p> <p>Here is some example code:</p> <pre><code> $this-&gt;load-&gt;library('Googlemaps'); $towers = $this-&gt;towers_model-&gt;get_towers(); $config['center'] = '18.557394170647473, -9.31640625'; $config['zoom'] = '2'; $this-&gt;googlemaps-&gt;initialize($config); foreach($towers as $tower) { $marker = array(); $marker['position'] = $tower-&gt;Lat.', '.$tower-&gt;Long; $marker['infowindow_content'] = '&lt;p&gt;'.$tower-&gt;Dedicn.'&lt;/p&gt;'; $marker['icon'] = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&amp;chld=A|9999FF|000000'; $this-&gt;googlemaps-&gt;add_marker($marker); } $this-&gt;data['map'] = $this-&gt;googlemaps-&gt;create_map(); $this-&gt;template-&gt;write('scripts', $this-&gt;data['map']['js']); $this-&gt;template-&gt;write_view('content', 'towers/view_all', $this-&gt;data); $this-&gt;template-&gt;render(); </code></pre> <p>As you can see I am trying to output $tower->Dedicn and when I do the map just won't load. I have echoed it out thought and its definately defined and contains content etc etc.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload