1

I looked around for a bit here and have been googleing for hours with no luck. I am trying to get a map to appear using google's map api but i am getting

"$("#map_canvas").gmap is not a function http://people.rit.edu/~ctn9382/536/assignment3/ Line 160" 

as an error. I have the demo working fine but for some reason it isn't working on the site i made. Can anybody tell me whats wrong?

here is the link: http://people.rit.edu/~ctn9382/536/assignment3/

in order to get to this point you have to click "show results" and then click a hospital's name and it should create a bunch of stuff on the top of the page.

Kara
  • 6,115
  • 16
  • 50
  • 57
SalmonMode
  • 281
  • 6
  • 17

1 Answers1

7

jQuery.js and jQuery-ui.min.js are both being included twice. The second time you include it, it overwrites all of the previously defined plugins such as gmap. Remove the second set of jQuery and jQuery UI script includes and your code should work.

Edit:

Change this:

<script type="text/javascript">
    google.load('maps','3',{'other_params':'sensor=false'});
    //google.load('jquery','1.7');
    //google.load('jqueryui','1.8.9');
</script>

It is loading a second copy of jquery.

I'm not sure about the first line.

Kevin B
  • 94,570
  • 16
  • 163
  • 180
  • Hmmm. Im trying but no matter which ones i get rid of it seems there is some complication. which ones should I be taking out. I tried trial and error but no such luck – SalmonMode Feb 22 '12 at 16:01
  • Sweet! Thanks..it sorta works now. just something weird is happening with the map. Its likes it there but not – SalmonMode Feb 22 '12 at 16:08
  • this has become a new issue so ill have to make another question for it i guess – SalmonMode Feb 22 '12 at 16:19
  • Thanks for your answer Kevin, it helped me resolve the issue in my MVC4 application. The @Scripts.Render("~/bundles/jquery") in the section of _Layout.cshtml was overriding/clearing the reference I had in my view. I removed it from my view and put the @Scripts.Render in the section of _layout.cshtml .. problem solved – mikecamimo Dec 11 '12 at 01:39
  • How you know I'm including twice? You are genius! I moved the @Scripts.Render("~/bundlers/jquery") to header at _Layout.cshtml so I no need to additional include again in all views. Thanks. – yancyn Oct 21 '13 at 05:09