Closed (fixed)
Project:
GMap Module
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2013 at 18:29 UTC
Updated:
26 Mar 2013 at 18:40 UTC
I'm adding a gmap from a .tpl, this is my code:
$map = array();
$map['markers'] = $markers;
$element = array(
'#type' => 'gmap',
'#gmap_settings' => $map,
);
$output = drupal_render($element);
print_r($output);
The map is loaded succesfully but the JS libraries are being added twice on header. My temporary workaround was to comment line 983 from gmap.module.
// Track the mapids we've used already.
static $mapids = array();
//_gmap_doheader(); <-- comment this line
$mapid = FALSE;
if (isset($element['#map']) && $element['#map']) {
Comments
Comment #1
johnvIMO this is introduced in commit #1061444-64: Javascript is required to view this map.: missing gmap_markers.js.
See also it's initial analysis in #13.
several functions do the same:
- function _gmap_base_js()
- _gmap_doheader()
- gmap_gmap()
Comment #2
podarokcan anyone provide a working patch for fixing this?
Comment #3
johnv@podarok, is the proposed solution the right one?
Comment #4
podarok#3 looks like not right
we should check already included js or not and do the right addition
Comment #5
johnvSo, I'll count this as 'no patch'.
Comment #5.0
johnvAdded line commented
Comment #6
johnvThis is fixed here: #1931138-29: Fixing all 'single marker' issues
Comment #7.0
(not verified) commentedUpdated issue summary.