【发布时间】:2015-08-22 11:59:00
【问题描述】:
我正在使用 CodeIgniter Google Maps V3 API 库 URL 在我的表单中选择位置。所以我的控制器如下:
$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);
view 是:
<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>
虽然我可以自动选择位置,但地图并未显示所选位置。我应该编写什么代码来显示所选位置,而不仅仅是提醒You selected a place。
【问题讨论】:
-
好像这个问题Link
标签: codeigniter google-maps google-maps-api-3