0

I'm new to MVCs and Angular and I tried to get angular-google-maps going by following the steps in the AGM QuickStart page. Firebug shows several errors, some of which I don't understand.

First, I get a 403 in accessing underscore. The message (minus localhost) is: "NetworkError: 403 Forbidden - angular-oPast/app/..../node_modules/underscore/underscore-min.js" Why can't I access code that's in my own PC?

Second, I get SyntaxError: missing } after property list }; with some reference to ngLocale, which is not in my code.

Third, I get ReferenceError: _ is not defined with some reference to MarkerLabel, which I am not using.

Fourth, I get [$injector:nomod] Module 'residenceApp' is not available! This is the name of the overall Angular app. Despite having done a couple tutorials, I don't know how to build this for using AGM or where to put it.

Fifth, per the AGM QuickStart, I have the following in my CSS

.angular-google-map-container {height:400px;}

This is a puzzle because the instructions say nothing about creating an HTML class=".angular-google-map-container" I did not put an HTML class attribute in like that because there were no instructions to do that. What is that CSS doing, and is it correct for my situation?

My HTML using ng looks like:

<html lang="en" data-ng-app="residenceApp">

<div id="gMapCanvas" data-ng-controller="GMapController2">
    <google-map center="map.center" zoom="map.zoom"></google-map>
</div>

Most of the rest of the HTML is mock up text, at this point.

My scripts look like:

<script src="..../node_modules/underscore/underscore-min.js"></script>
<script src="common/gmapGenerator2.js"></script>
<script src="common/mapGenerator/dist/angular-google-maps.min.js"></script>

Maybe I should say that example.html for AGM works in my PC. So I have the necessary code in the system. It just doesn't have dependencies set right, or something.

What do I need to do to fix these problems and get Google Maps working? I can provide more info, if necessary.

Mike_Laird
  • 1,124
  • 4
  • 16
  • 40
  • OK, I got rid of the Module 'residenceApp' is not available by putting in at the end of the body. However, I now have a new error - Error: [ng:areq] Argument 'GMapController2' is not a function, got undefined . . . etc. – Mike_Laird May 23 '14 at 00:41
  • OK, Aviv Ben-Yosef, told me the node_modules script link was disallowed by standard Apache settings, which allow only 1 hop up. I could not find a way to change Apache, so I moved the node_modules directory up one. Sure enough, a fix to the 403 problem and the ReferenceError problem. The #2 syntax error, missing } after property list in ngLocale, remains. The above bandaid for the app module and the resulting 'not a function' error remain. – Mike_Laird May 27 '14 at 20:20
  • After more research, it turns out an error is indeed in the node_modules link, but it is not as stated in the above comment. The error is syntax. It should read src="../../node_modules etc. " Apache executes the 2 hops up with standard configs. – Mike_Laird May 29 '14 at 16:38
  • I have gotten the Firebug error list down to just - Error: [ng:areq] Argument 'GMapController2' is not a function, got undefined Since the controller function was not known to be a problem and I didn't post it, this remaining problem is can't be solved in this post. Hope these comments help someone with the solved problems. – Mike_Laird May 29 '14 at 17:19
  • When the code in instruction #3 and #4 of the AGM Quickstart is combined into 1 Angular controller that is modeled off the controller example in Step 2 of the tutorial at angularjs.org, then voila, the Google map appears. – Mike_Laird Jun 02 '14 at 19:35

0 Answers0