1. Home >
  2. Documentation >
  3. data types >
  4. callback
 

callback

The callback function takes one parameter which is the result of the action asserted and depends on the request.

In this example, you can see one another important feature of gmap3, in callback $(this) is equivalent to the current jQuery element which is there $("#test")

$("#test").gmap3({
  getlatlng:{
    address:  "Paris, France",
    callback: function(results){
      if ( !results ) return;
      $(this).gmap3({
        marker:{
          latLng:results[0].geometry.location
        }
      });
    }
  }
});
Close