Google Maps - marker setzten

Cäptin Pommes

Erfahrenes Mitglied
hi leute,

ich arbeite gerade an einem kleinen asp projekt und muss google Maps einbinden. Das hat soweit auch schonmal geklappt nur leider will so ein Marker nich auf der Karte angezeigt werden :/

HTML:
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
        html, body, #map-canvas {
            margin: 0;
            padding: 0;
            height: 100%;
        }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
        var map;
        function initialize() {
            var mapOptions = { zoom: 6, center: new google.maps.LatLng(52.397, 10.644), mapTypeId: google.maps.MapTypeId.ROADMAP };
            map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
        }

        google.maps.event.addDomListener(window, 'load', initialize);

        var myLatlng = new google.maps.LatLng(52.397, 10.644);
        var marker = new google.maps.Marker({
            position: myLatlng, map: map, title: "Hello World!"
        });

    </script>
</head>
<body>
    <div id="map-canvas"></div>
</body>
</html>


weiß jemand was ich falsch mache? :/
 

Neue Beiträge

Zurück