Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

In my app, after click on the google map, I need to get the lat and lng information for further handling. And since the app use angualrjs as the frame, so i used the google map angular as. the coding is as following:

$scope.map = {
        center: {
        latitude: 37.782551,
        longitude: -122.445368
        },
        zoom: 12,
        heatLayerCallback: function (layer) {

            MockHeatLayer(layer);
            },
        showHeat: true,
        // the issue is from here
        onclick: {
            click : function(maps, event, arguments) {
                console.log(event.latLng); //return undefined 
                console.log(typeof(event)); //return string type instead of event object 

            }
        }
    };

})

and HTML tag is as following:

<ui-gmap-google-map center='map.center' zoom='map.zoom' events='map.onclick'>
    <ui-gmap-layer namespace="visualization" type="HeatmapLayer" show="map.showHeat" onCreated="map.heatLayerCallback"></ui-gmap-layer>
</ui-gmap-google-map>

as you can see, set the events to onclick in the map array.
But after debugging, the the event in the handle function is a string instead of object, so what is the problem?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.