-3

Alright so this is the first time I see this problem while using Google Maps.

I have 2 simple files (html & JS) and it seems that one of them is causing these errors

HTML

<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="css/test.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <script src="map.js"> </script>
    </head>

    <body>
        <div id="test">
            <iframe id="map" width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?hl=en&amp;ie=UTF8&amp;ll=37.0625,-95.677068&amp;spn=56.506174,79.013672&amp;t=m&amp;z=4&amp;output=embed"></iframe>
        </div>
    </body>
</html>

Java script

$(document).ready(function() {
    initialize();

    function initialize() {
      var myOptions = {
        zoom: 4,
        center: new google.maps.LatLng(-33, 151),
        disableDefaultUI: true,
        mapTypeId: google.maps.MapTypeId.ROADMAP  
      }
      var map = new google.maps.Map(document.getElementById("map"),
           myOptions);
    }
});

Error

map.js:1 Uncaught ReferenceError: $ is not defined(anonymous function) @ map.js:1 util.js:138 XHR finished loading: GET "https://www.google.com/maps/vt?pb=!1m4!1m3!1i4!2i1!3i5!1m4!1m3!1i4!2i1!3i6!…ty_class!2s0!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e3!12m1!5b1&token=114164".SF @ util.js:138_.TF @ util.js:138(anonymous function) @ onion.js:9XU.load @ onion.js:71$U @ onion.js:15YU.l @ onion.js:71 util.js:138 XHR finished loading: GET "https://www.google.com/maps/vt?pb=!1m4!1m3!1i4!2i4!3i7!1m4!1m3!1i4!2i5!3i6!…ity_class!2s0!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e3!12m1!5b1&token=15750".

All I am trying to do is quite simple, I am trying to disable google maps options.

1 Answers1

0

Do you have jQuery linked in your HTML? The $ var is looking for active jQuery to execute your initialize() function.

belwerks
  • 17
  • 3
  • 1
    this isn't an answer .. use comment blocks to ask for clarification. It's not hard to get the 50 rep points needed to be able to use them – charlietfl Oct 12 '16 at 18:34
  • Yeah I have the Jquery linked, I accidentaly removed that part on code while I was posting but yep, I have it. – Senior Gamer Oct 12 '16 at 18:35