I am able to print the map using Drupal code in a div. I would like this map to appear inside a fancybox and to be hidden on the website. I've managed to do it (fancybox works ok) however the map is not displayed correctly - there is no navigation and only grey empty area inside Map (though google logo is there). Does anyone have an idea what could be wrong here? I guess it might be the case that ID renders only one element, so it only renders the background and the rest is ignored, but to be honest I have no idea(use class instead). Any advice appreciated. Thanks
My code:
<script type="text/javascript">
$(document).ready(function() {
$("a#inline").fancybox({
'hideOnContentClick': true,
'overlayColor' : '#ccffee',
'overlayOpacity' : 0.8
});
});
</script>
Link to show the map:
<a id="inline" href="#mapcontainer" >
Show Map
</a>
Actual Div that prints the map (works perfectly when set visible)
<div style="display:none">
<div id="mapcontainer">
<?php print $node->content['field_maploc']['field']['items']['#children'] ?> </div></div>
The PHP code generates the following html:
<div style="width: auto; height: 400px;" id="openlayers-container-openlayers-map-auto-id-0" class="openlayers-container openlayers-container-preset-question_map"> <div style="width: auto; height: 400px;" id="openlayers-map-auto-id-0" class="openlayers-map openlayers-preset-question_map"></div> </div>
The current output -