admin管理员组文章数量:1295887
I have an application where I am trying to implement google maps on angular app to show where the coordinates are on the map when the user selects a place. When I try to load this app i get the error. The HTML works fine but google map does not show on my app. It can be viewed on:
/
gMarker.key undefined and it is REQUIRED!!
Below is the code: HTML:
<script src=",geometry,visualization&sensor=false&language=en&v=3.14"></script>
<script data-require="[email protected]" src=".2.16/angular.js" data-semver="1.2.16"></script>
<script src=".js/2.4.1/lodash.underscore.min.js"></script>
<script src=".js"></script>
<script src="controllers.js"></script>
</head>
<body ng-controller="mainCtrl">
<select ng-model="selectedCoordinate" ng-options="coordinate.caption for coordinate in coordinates">
</select>
<label>zoom</label>
<input type="number" ng-model="zoom"/>
<div id="map_canvas">
<google-map center="selectedCoordinate" zoom="zoom" draggable="true" options="options">
<marker coords="selectedCoordinate"></marker>
</google-map>
</div>
I have provided head files as there have been errors due to the files before. How can I resolve this error?
I have an application where I am trying to implement google maps on angular app to show where the coordinates are on the map when the user selects a place. When I try to load this app i get the error. The HTML works fine but google map does not show on my app. It can be viewed on:
http://creative.coventry.ac.uk/~4078078/Map/
gMarker.key undefined and it is REQUIRED!!
Below is the code: HTML:
<script src="http://maps.googleapis./maps/api/js?libraries=weather,geometry,visualization&sensor=false&language=en&v=3.14"></script>
<script data-require="[email protected]" src="http://code.angularjs/1.2.16/angular.js" data-semver="1.2.16"></script>
<script src="http://cdnjs.cloudflare./ajax/libs/lodash.js/2.4.1/lodash.underscore.min.js"></script>
<script src="http://rawgithub./angular-ui/angular-google-maps/master/dist/angular-google-maps.js"></script>
<script src="controllers.js"></script>
</head>
<body ng-controller="mainCtrl">
<select ng-model="selectedCoordinate" ng-options="coordinate.caption for coordinate in coordinates">
</select>
<label>zoom</label>
<input type="number" ng-model="zoom"/>
<div id="map_canvas">
<google-map center="selectedCoordinate" zoom="zoom" draggable="true" options="options">
<marker coords="selectedCoordinate"></marker>
</google-map>
</div>
I have provided head files as there have been errors due to the files before. How can I resolve this error?
Share Improve this question asked Aug 14, 2014 at 11:26 butYouDontLookLikeADeveloperbutYouDontLookLikeADeveloper 3371 gold badge6 silver badges23 bronze badges1 Answer
Reset to default 10I believe you're missing the idkey
parameter on your marker
directive.
<div id="map_canvas">
<google-map center="selectedCoordinate" zoom="zoom" draggable="true" options="options">
<marker idkey="{expression}" coords="selectedCoordinate"></marker>
</gooogle-map>
</div>
This is new in version 1.2.0. You can read more about here.
本文标签: javascriptgMarkerkey undefined and it is REQUIRED error in angular and google maps appStack Overflow
版权声明:本文标题:javascript - gMarker.key undefined and it is REQUIRED!! error in angular and google maps app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741620363a2388774.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论