Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:59:45+00:00 2026-05-24T21:59:45+00:00

I have made a site with codeigniter and am using the googlemaps v3 library

  • 0

I have made a site with codeigniter and am using the googlemaps v3 library 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.

Here is some example code:

    $this->load->library('Googlemaps');
    $towers = $this->towers_model->get_towers();

    $config['center'] = '18.557394170647473, -9.31640625';
    $config['zoom'] = '2';
    $this->googlemaps->initialize($config);

    foreach($towers as $tower) {
        $marker = array();
        $marker['position'] = $tower->Lat.', '.$tower->Long;
        $marker['infowindow_content'] = '<p>'.$tower->Dedicn.'</p>';
        $marker['icon'] = 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|9999FF|000000';
        $this->googlemaps->add_marker($marker);
    }

    $this->data['map'] = $this->googlemaps->create_map();

    $this->template->write('scripts', $this->data['map']['js']);
    $this->template->write_view('content', 'towers/view_all', $this->data);
    $this->template->render();

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:59:47+00:00Added an answer on May 24, 2026 at 9:59 pm

    Ahhh I found out why! It’s because some of the results had speech marks in them which interfered with the javascript so had to use str_replace to replace ” with \” to escape them!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my Drupal site, I have made a Users page using the Views module,
I have this custom made site using Jekyll: http://madhur.github.com/ When I view this site
I have made a simple accordion for my site using jQuery... It worked great,
I have made a site with classic php and mysql functions. I order to
Post-release, I have made one small change to one form in our development site
Hi I made this site a while ago in my table days but have
I have a site I made really fast that uses floats to display different
I currently have a community site that I run that is made up of
I have made a custom UserControl i Vb.net (windows application). How can I add
I have a PHP / CodeIgniter site with basic social functionality which obviously includes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.