GMarker.key is undefined and it is NECESSARY !! bug in angular and google maps app

I have an application in which I try to implement google maps in an angular application to show where the coordinates are on the map when the user selects a place. When I try to download this application, I get an error message. HTML works fine, but google map is not showing in my application. It can be viewed on the page:

http://creative.coventry.ac.uk/~4078078/Map/ 

gMarker.key is undefined and it is REQUIRED !!

The following is the code: HTML:

  <script src="http://maps.googleapis.com/maps/api/js?libraries=weather,geometry,visualization&sensor=false&language=en&v=3.14"></script> <script data-require=" angular.js@1.2.x " src="http://code.angularjs.org/1.2.16/angular.js" data-semver="1.2.16"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.underscore.min.js"></script> <script src="http://rawgithub.com/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 since there used to be errors due to files. How can I solve this error?

+5
source share
1 answer

I believe that you did not specify the idkey parameter in 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 learn more about this .

+9
source

Source: https://habr.com/ru/post/1200316/


All Articles