muazzamazaz
1 year ago

SyntaxError: missing : after property id

Posted 1 year ago by muazzamazaz

I have write the following code

 var geocoder =  new google.maps.Geocoder();
 
     var map;
     var markers = [
         @foreach($locationList as $location)
         {
             location_id: "{{ $location->id }}",
             geocoder.geocode( { 'address': "{{ $location->city }}"}, function(results, status) {
           if (status == google.maps.GeocoderStatus.OK) { 
           lat: results[0].geometry.location.lat(),
            lng: results[0].geometry.location.lng(),
           }
         }
         });
             
             
         },
         @endforeach
     ];

But it give me error

SyntaxError: missing : after property id

Please sign in or create an account to participate in this conversation.