Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one map in foreach. #89

Closed
RydelHouse opened this issue Sep 20, 2014 · 2 comments
Closed

Only one map in foreach. #89

RydelHouse opened this issue Sep 20, 2014 · 2 comments
Labels

Comments

@RydelHouse
Copy link

Hello,

First of all I would like to say thank you for great library!

But I have some problems. I am using this library to show map for each registered user. But in all user list only one map is showing.

This is my method:

public function findCompaniesAction() {
    $em = $this->getDoctrine()->getManager();

    $companies = $em->createQueryBuilder()
        ->select('b')
        ->from('RFQIronilBundle:User',  'b')
        ->where('b.acc_type = 1')
        ->getQuery()
        ->getResult();

    foreach ($companies as $key => $company) {
        $map = $this->get('ivory_google_map.map');
        $map->setMapOption('mapTypeId', MapTypeId::ROADMAP);
        $map->setMapOption('mapTypeId', 'roadmap');
        $company->map = $map;
    }

    return $this->render('RFQIronilBundle:Default:find-companies.html.twig', array(
        'companies'     => $companies
    ));
}

and in my view I use:

{% for companies in companies %}
{{ google_map_container(companies.map) }}
{{ google_map_js(companies.map) }}
{% endfor %}

All is fine, but map is showing for only first user. What I have missed?

@egeloen
Copy link
Owner

egeloen commented Oct 7, 2014

This is unfortunately a know limitation related to #87 which will can only be fixed in the next major release.

@egeloen egeloen added the bug label Oct 7, 2014
@egeloen egeloen mentioned this issue Oct 19, 2014
4 tasks
@egeloen
Copy link
Owner

egeloen commented Aug 12, 2016

Your issue has been fixed by #134 but will only be part of the 2.x version.

@egeloen egeloen closed this as completed Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants