CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #27061

2.0.3: generated URL for GoogleMaps is wrong. "()at the end of URL..."

Added by topshopper almost 2 years ago. Updated over 1 year ago.

Status:New Start date:2011-05-26
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:- Spent time: -
Target version:-
Votes: 0

Description

Hi,

i am using your extension in Version 2.0.3.

I found a bug in Singlevie and GoogleMaps.

In the Popups the PLZ is missing, but it is in the stored in the data.

The generated URL is like:

http://maps.google.com/maps?saddr=60599+frankfurt&daddr=50.080926%2C8.6491735%28%29

or "from: 60599 frankfurt to: 50.080926,8.6491735()"

So the "()" at the end of URL is too much. GoogleMaps can´t find the route.

How can i fix this?

Bild_4.png (137.4 kB) topshopper , 2011-05-26 19:31

History

Updated by topshopper almost 2 years ago

Updated by Andreas Schilkowski over 1 year ago

topshopper wrote:

Hi,

i am using your extension in Version 2.0.3.

I found a bug in Singlevie and GoogleMaps.

In the Popups the PLZ is missing, but it is in the stored in the data.

The generated URL is like:

http://maps.google.com/maps?saddr=60599+frankfurt&daddr=50.080926%2C8.6491735%28%29

or "from: 60599 frankfurt to: 50.080926,8.6491735()"

So the "()" at the end of URL is too much. GoogleMaps can´t find the route.

How can i fix this?

replace in GoogleMapAPI.class :

(around 1102)
$_output .= sprintf(
"to_htmls[counter] = html0.contentElem + '<form class=\"gmapDir\" id=\"gmapDirTo\" style=\"white-space: nowrap;\" action=\"http://maps.google.com/maps\" method=\"get\" target=\"_blank\">' +
'<span class=\"gmapDirHead\" id=\"gmapDirHeadTo\">%s<strong>%s</strong> - <a href=\"javascript:fromhere(' + counter + ')\">%s</a></span>' +
'<p class=\"gmapDirItem\" id=\"gmapDirItemTo\"><label for=\"gmapDirSaddr\" class=\"gmapDirLabel\" id=\"gmapDirLabelTo\">%s<br /></label>' +
'<input type=\"text\" size=\"40\" maxlength=\"40\" name=\"saddr\" class=\"gmapTextBox\" id=\"gmapDirSaddr\" value=\"\" onfocus=\"this.style.backgroundColor = \'#e0e0e0\';\" onblur=\"this.style.backgroundColor = \'#ffffff\';\" />' +
'<span class=\"gmapDirBtns\" id=\"gmapDirBtnsTo\"><input value=\"%s\" type=\"%s\" class=\"gmapDirButton\" id=\"gmapDirButtonTo\" /></span></p>' +
'<input type=\"hidden\" name=\"daddr\" value=\"' +
point.y + ',' + point.x + \"(\" + title.replace(new RegExp(/\"/g),'"') + \")\" + '\" /></form>';
from_htmls[counter] = html0.contentElem + '<p /><form class=\"gmapDir\" id=\"gmapDirFrom\" style=\"white-space: nowrap;\" action=\"http://maps.google.com/maps\" method=\"get\" target=\"_blank\">' +
'<span class=\"gmapDirHead\" id=\"gmapDirHeadFrom\">%s<a href=\"javascript:tohere(' + counter + ')\">%s</a> - <strong>%s</strong></span>' +
'<p class=\"gmapDirItem\" id=\"gmapDirItemFrom\"><label for=\"gmapDirSaddr\" class=\"gmapDirLabel\" id=\"gmapDirLabelFrom\">%s<br /></label>' +
'<input type=\"text\" size=\"40\" maxlength=\"40\" name=\"daddr\" class=\"gmapTextBox\" id=\"gmapDirSaddr\" value=\"\" onfocus=\"this.style.backgroundColor = \'#e0e0e0\';\" onblur=\"this.style.backgroundColor = \'#ffffff\';\" />' +
'<span class=\"gmapDirBtns\" id=\"gmapDirBtnsFrom\"><input value=\"%s\" type=\"%s\" class=\"gmapDirButton\" id=\"gmapDirButtonFrom\" /></span></p>' +
'<input type=\"hidden\" name=\"saddr\" value=\"' +
point.y + ',' + point.x + \"(\" + title.replace(new RegExp(/\"/g),'"') + \")\" + '\" /></form>';
html0.contentElem = html0.contentElem + '<p /><div id=\"gmapDirHead\" class=\"gmapDir\" style=\"white-space: nowrap;\">%s<a href=\"javascript:tohere(' + counter + ')\">%s</a> - <a href=\"javascript:fromhere(' + counter + ')\">%s</a></div>';\n",

with

$_output .= sprintf(
"to_htmls[counter] = html[0].contentElem + '&lt;form class=\"gmapDir\" id=\"gmapDirTo\" style=\"white-space: nowrap;\" action=\"http://maps.google.com/maps\" method=\"get\" target=\"_blank\"&gt;' +
'&lt;span class=\"gmapDirHead\" id=\"gmapDirHeadTo\"&gt;%s&lt;strong&gt;%s&lt;/strong&gt; - &lt;a href=\"javascript:fromhere(' + counter + ')\"&gt;%s&lt;/a&gt;&lt;/span&gt;' +
'&lt;p class=\"gmapDirItem\" id=\"gmapDirItemTo\"&gt;&lt;label for=\"gmapDirSaddr\" class=\"gmapDirLabel\" id=\"gmapDirLabelTo\"&gt;%s&lt;br /&gt;&lt;/label&gt;' +
'&lt;input type=\"text\" size=\"40\" maxlength=\"40\" name=\"saddr\" class=\"gmapTextBox\" id=\"gmapDirSaddr\" value=\"\" onfocus=\"this.style.backgroundColor = \'#e0e0e0\';\" onblur=\"this.style.backgroundColor = \'#ffffff\';\" /&gt;' +
'&lt;span class=\"gmapDirBtns\" id=\"gmapDirBtnsTo\"&gt;&lt;input value=\"%s\" type=\"%s\" class=\"gmapDirButton\" id=\"gmapDirButtonTo\" /&gt;&lt;/span&gt;&lt;/p&gt;' +
'&lt;input type=\"hidden\" name=\"daddr\" value=\"' +
point.y + ',' + point.x + '\" />&lt;/form&gt;';
from_htmls[counter] = html[0].contentElem + '&lt;p /&gt;&lt;form class=\"gmapDir\" id=\"gmapDirFrom\" style=\"white-space: nowrap;\" action=\"http://maps.google.com/maps\" method=\"get\" target=\"_blank\"&gt;' +
'&lt;span class=\"gmapDirHead\" id=\"gmapDirHeadFrom\"&gt;%s&lt;a href=\"javascript:tohere(' + counter + ')\"&gt;%s&lt;/a&gt; - &lt;strong&gt;%s&lt;/strong&gt;&lt;/span&gt;' +
'&lt;p class=\"gmapDirItem\" id=\"gmapDirItemFrom\"&gt;&lt;label for=\"gmapDirSaddr\" class=\"gmapDirLabel\" id=\"gmapDirLabelFrom\"&gt;%s&lt;br /&gt;&lt;/label&gt;' +
'&lt;input type=\"text\" size=\"40\" maxlength=\"40\" name=\"daddr\" class=\"gmapTextBox\" id=\"gmapDirSaddr\" value=\"\" onfocus=\"this.style.backgroundColor = \'#e0e0e0\';\" onblur=\"this.style.backgroundColor = \'#ffffff\';\" /&gt;' +
'&lt;span class=\"gmapDirBtns\" id=\"gmapDirBtnsFrom\"&gt;&lt;input value=\"%s\" type=\"%s\" class=\"gmapDirButton\" id=\"gmapDirButtonFrom\" /&gt;&lt;/span&gt;&lt;/p&gt;' +
'&lt;input type=\"hidden\" name=\"saddr\" value=\"' +
point.y + ',' + point.x + '\" />&lt;/form&gt;';
html[0].contentElem = html[0].contentElem + '&lt;p /&gt;&lt;div id=\"gmapDirHead\" class=\"gmapDir\" style=\"white-space: nowrap;\"&gt;%s&lt;a href=\"javascript:tohere(' + counter + ')\"&gt;%s&lt;/a&gt; - &lt;a href=\"javascript:fromhere(' + counter + ')\"&gt;%s&lt;/a&gt;&lt;/div&gt;';\n",

Also available in: Atom PDF