egeloen / ivory-google-map

Google Map API v3 integration for PHP 5.6+.
MIT License
325 stars 185 forks source link

Map not respecting DOM structure #247

Open ChrisMwai opened 7 years ago

ChrisMwai commented 7 years ago

The map seems to place itself directly after the opening tag. Is this behavior normal? You cant target any other div?

ChrisMwai commented 7 years ago

screenshot from 2017-07-05 19-00-18 screenshot from 2017-07-05 19-00-40

ChrisMwai commented 7 years ago

As you can see below, the map has ben rendered just after the tag, messing up the entire layout.

screenshot from 2017-07-05 19-05-46

RadBoris commented 7 years ago

Has this been addressed? For Laravel 5.4, you can render a generic map (using render()) in a blade view but the actual map data is missing. If you echo() from controller, you don't appear to have control where the map is rendered.

egeloen commented 7 years ago

Can you please refine your issue? AFAIK, the html generated is valid, what do you mean by not respecting the DOM?

jhoskins98 commented 7 years ago

For Laravel - need a div with id of map_canvas as the target. And then you need to pass in a couple of variables for map helper and api helper and the map variable itself. Then put them in your blade a couple of lines to get all the javascript in: {!! $mapHelper->render($map) !!} {!! $apiHelper->render([$map]) !!}