Marker description showing twice
Posted: 24 Jun 2010, 11:45
I have a map with two markers. The first marker shows in info window:
Marker 1 Headline
Bla
Bla
Bla
The second Marker shows:
Marker 1 Headline
Bla
Bla
Bla
Marker 2 Headline
Bla
Bla
Bla
It seems that the plugin is loading every marker description in second marker window, not only the one set in the marker.
Why is that an how can i fix it?
Heres my phocamaps.php (plugin) that i changed previously for displaying images in marker description properly (removed "addslashes" in $text and commented out displaying the title):
Marker 1 Headline
Bla
Bla
Bla
The second Marker shows:
Marker 1 Headline
Bla
Bla
Bla
Marker 2 Headline
Bla
Bla
Bla
It seems that the plugin is loading every marker description in second marker window, not only the one set in the marker.
Why is that an how can i fix it?
Heres my phocamaps.php (plugin) that i changed previously for displaying images in marker description properly (removed "addslashes" in $text and commented out displaying the title):
Code: Select all
// Markers
jimport('joomla.filter.output');
if (isset($markerp) && !empty($markerp)) {
$iconArray = array(); // add information about created icons to array and check it so no duplicity icons js code will be created
foreach ($markerp as $key => $markerV) {
if ((isset($markerV->longitude) && $markerV->longitude != '')
&& (isset($markerV->latitude) && $markerV->latitude != '')) {
//$text = '>' . addslashes($markerV->title) . '</h1>';
$text .= '<div>'. PhocaMapsHelper::strTrimAll($markerV->description).'</div>';
if ($markerV->displaygps == 1) {
$text .= '<div class="pmgps"><table border="0"><tr><td><strong>'. JText::_('GPS') . ': </strong></td>'
.'<td>'.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslatitude)).'</td></tr>'
.'<tr><td></td>'
.'<td>'.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslongitude)).'</td></tr></table></div>';
}
if(empty($markerV->icon)) {
$markerV->icon = 0;
}
if(empty($markerV->title)){
$markerV->title = '';
}
if(empty($markerV->description)){
$markerV->description = '';
}
$iconOutput = $map->setMarkerIcon($markerV->icon);
if (!in_array($markerV->icon, $iconArray)) {
$output .= $iconOutput['js'];
$iconArray[] = $markerV->icon;
}
$output .= $map->setMarker($markerV->id,$markerV->title,$markerV->description,$markerV->latitude, $markerV->longitude, $iconOutput['icon'], $iconOutput['iconid'], $text, $markerV->contentwidth, $markerV->contentheight, $markerV->markerwindow );
}
}
}
if ($tmpl['load_kml']) {
$output .= $map->setKMLFile($tmpl['load_kml']);
}
if ($tmpl['displaydir']) {
$output .= $map->setDirectionDisplayService('phocaDir');
}
$output .= $map->setListener();
$output .= $map->endMapFunction();
if ($tmpl['displaydir']) {
$output .= $map->setDirectionFunction($tmpl['display_print_route'], $mapp->id, $mapp->alias, $tmpl['lang']);
}
$output .= $map->setInitializeFunction();
$output .= $map->endJScData();
}
$output .= '<div style="clear:both"></div>';
$output .= '</div>';