• Andrew Frederick 5
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,
I am having issue in passing latitude and longitude as an event parameters. Below is my onBoatClick controller.
({
	onBoatClick : function(component, event, helper) {
        var BoatSelectEvent = component.getEvent("BoatSelect");
        var boatSelected = component.get("v.boat");
        BoatSelectEvent.setParam(
            "boatId",boatSelected.Id);
        BoatSelectEvent.fire();
        var BoatSelectedEvt = $A.get("e.c:BoatSelected");
        var Boat = component.get("v.boat");
        BoatSelectedEvt.setParams({
            "boat" : Boat
        }) ;
        console.log('Firing event' +Boat);
        BoatSelectedEvt.fire();
        
        var boat=component.get('v.boat');
        console.log('Boat Selected Id in boattile' + boat.Id);
        var lat = boat.Geolocation_Latitude__s;
        var long = boat.Geolocation_Longitude__s;
        var label = boat.Name;
        console.log('boat name in BoatTile'+ label);
        console.log('Latitude in BoatTile' + lat);
        console.log('Longitude in BoatTile' + long);
        var PlotMapMarkerEvent = $A.get("e.c:PlotMapMarker");
         PlotMapMarkerEvent.setParams({
            "lat"   : lat,
            "long"  : long,
            "label" : label,
             "SObjectId" : boat.Id });
         PlotMapMarkerEvent.fire();
        
		
	} ,

console.log display label and boat Id. However values for lat and lon is undefined. Not sure, what I am missing here.

Any help is appreciated. 

Thanks much.