multiple bing map inside foreach loop Ask RRS feed

  • Question

  •   <?php 
          foreach (list_visited_place() as $list_visited_place) { 
                    <div id="<?php echo $list_visited_place->id_visited_lived_place; ?>_visited_place_map" style='width: 400px; height: 400px; border: 3px solid black;'>
                    <script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?key=HEREMYKEY&callback=loadMapScenario' async defer></script>
                    <script type='text/javascript'>
                        function loadMapScenario() {
                          var  map = new Microsoft.Maps.Map(document.getElementById('<?php echo $list_visited_place->id_visited_lived_place; ?>_visited_place_map'), {});

    That code only show map of the last element of the loop. Or i would like it to show maps of each elements of the loop.

    How could i do it please ?

    • Moved by Duncan Lawler Thursday, February 28, 2019 10:28 PM wrong area
    Thursday, February 28, 2019 8:17 PM

All replies