So zeigen Sie eine Google-Karte in Modal Bootstrap 4 anPhp

PHP-Programmierer chatten hier
Anonymous
 So zeigen Sie eine Google-Karte in Modal Bootstrap 4 an

Post by Anonymous »

Ich würde innerhalb des Modals eine Google-Karte anzeigen, ohne die API zu verwenden.
Innerhalb der Schleife können sich die Koordinaten ändern (ich schreibe für dieses Beispiel nur eine Konstante)
Ich habe es versucht. Das Modal erscheint, aber nicht die Karte.

Vielen Dank

meine Schleife

Code: Select all

 $i = 0;
foreach ($result as $value) {
$geolocalisation = '
' . Core::getDef('modules_test') . ' |


-----





';
Das Skript muss die Karte anzeigen

Code: Select all

 $geolocalisation .= '

function initialize() {
var mapOptions = {
center: new google.maps.LatLng(51.219987, 4.396237),
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapCanvas"),
mapOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(51.219987, 4.396237)
});
marker.setMap(map);
}

';

$methods[]= ['id'     => $value->id,
'title'  => '
' . $value->name . ' ' .  $value->address . ' ' .  $value->addressOptional . ' ' .  $value->locality. ' '  .  $value->city . ' ' .  $value->postalCode . ' ' .  $value->partialClosed . ' ' .  $geolocalisation,
'cost'   => 5.50
];
$i++;
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post