I am using CodeIgniter Google Maps V3 API Library URL to select location in my form. So my controller is as below :
$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$config['places'] = TRUE;
$config['placesAutocompleteInputID'] = 'event_location';
$config['placesAutocompleteBoundsMap'] = TRUE; // set results biased towards the maps viewport
$config['placesAutocompleteOnChange'] = 'alert(\'You selected a place\');';
$this->googlemaps->initialize($config);
And the view
is :
<div class="form-group">
<label class="col-md-3 col-xs-12 control-label">Select Venue in google map</label>
<div class="col-md-6 col-xs-12">
<?php
$google_map_date = array(
'name' => 'event_location',
'type' => 'text',
'id' => 'event_location',
'class' => 'form-control',
);
?>
<?php echo form_input($google_map_date);?>
<span class="help-block"></span>
</div>
<div class="col-md-12 col-xs-12">
<?php echo $map['html']; ?>
</div>
</div>
Although I am able to autoselect the locations, the map is not showing the selected location. What should I code , to show the selected location instead of just alerting You selected a place
.
Here is the working example: