I can print the map using the Drupal code in the div. I would like this map to appear inside fancybox and hide on the website. I managed to do this (fancybox is working fine), but the map does not display correctly - there is no navigation on the map and only a gray blank area (although there is a google logo). Does anyone have an idea what might be wrong here? I suppose it could be that the identifier only displays one element, so it only displays the background, and the rest are ignored, but to be honest, I have no idea (use the class instead). Any advice is appreciated. Thanks
My code is:
<script type="text/javascript"> $(document).ready(function() { $("a#inline").fancybox({ 'hideOnContentClick': true, 'overlayColor' : '#ccffee', 'overlayOpacity' : 0.8 }); }); </script>
Link to display the map:
<a id="inline" href="#mapcontainer" > Show Map </a>
The actual div that prints the card (works fine if set to visible)
<div style="display:none"> <div id="mapcontainer"> <?php print $node->content['field_maploc']['field']['items']['#children'] ?> </div></div>
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>
Current output -
source share