I show a map with locpick behavior, but the "locpick" marker isn't visible until I click the map. Added my example code and a patch to set initial marker if there is one.
$map_id = gmap_get_auto_mapid();
$map = array_merge(gmap_defaults(), gmap_parse_macro('[gmap zoom=13|width=100%|height=500px|control=Large|type=Map]'));
$map['id'] = $map_id;
$map['points'] = array();
$map['pointsOverlays'] = array();
$map['lines'] = array();
$map['behavior']['locpick'] = TRUE;
$map['behavior']['collapsehack'] = TRUE;
$map['latitude'] = $location->latitude;
$map['longitude'] = $location->longitude;
$form['latitude']['#map'] = $map_id;
gmap_widget_setup($form['latitude'], 'locpick_latitude');
$form['longitude']['#map'] = $map_id;
gmap_widget_setup($form['longitude'], 'locpick_longitude');
$form['map'] = array(
'#type' => 'gmap',
'#gmap_settings' => $map,
);
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | locpick_no_marker-1847676-1.patch | 837 bytes | logaritmisk |
| locpick_no_marker.patch | 914 bytes | logaritmisk |
Comments
Comment #1
logaritmisk commentedOups, that didn't work like it should. New patch.
Comment #2
podarokthanks
commited pushed to 7.x-2.x dev
need backport to 7.x-1.x-dev
Comment #3
podaroktagging