You are not logged in.
Pages: 1
Here is the sceneario
1) im using a json system to add data to markers similar to http://jsfiddle.net/3d2cQ/
2) all the markers load inside the infowindow with this type of click event: http://jsfiddle.net/BA8k4/
my problem:
how do i add a HREF link to the info window so that lets say the click on a link within the infowindow the user goes to another page.
I tried modifying the JSON to include HREF tag but that didnt work - or should it work?
im using PHP to build my ajax json tag which retrieve from my ajax call.
Any examples or solution suggested for this problem?
tks
Offline
You can put html in infoWindow, including anchors.
Provide example of what you tried. Demo's you provided are only using text.
Offline
moving From
data:'test1 !'
to
data:'test1 <br><a href="thisurl"> get this to work</a>'
should do
no ?
Last edited by mahieux06 (2012-06-11 14:09:55)
Offline
I tried that myself and could see the markup rather than the HTML rendering.
Offline
yep example would help much
Offline
I´ve got the same problem. But just when I try to use two links. My projekt is a gmap3 with some markers. Each marker has an infowindow. The text for this infowindow is type in my jason under â€descriptionâ€. So there is no problem with text in there or a link. But just when I try to type in two or more links, my map don´t show any marker or infowindow in the browser. Just my old Firefox 3.6.24) forgive my mistake. But for example under Safari (5.0.5) or a newer Firefox, only the clean map is loading.
So here is the json:
{
"places": [
{
"title": "Cafe Raab",
"description": "Café Raab",
"lat": 50.0040,
"lng": 8.2015,
"image": "marker_cafe.png"
},
{
"title": "Am Sportfeld",
"description": "<a href=\"http://way/to/link/site.html\" target=\"_blank\">MVGmeinRad Station</a>",
"lat": 50.00477,
"lng": 8.20110,
"image": "marker_radstation.png"
},
{
"title": "Kapellenstraße / Gesundheitszentrum",
"description": "<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>
<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 64</a>(Mz-Laubenheim <-> Budenheim) <br></br>
<a href=\"http://way/to/link/site.html\" target=\"_blank\">Straßenbahnlinie 50</a> (Mz-Hechtsheim <-> Mz-Finthen)<br></br>
<a href=\"http://way/to/link/site.html\" target=\"_blank\">Straßenbahnlinie 51</a>(Mz-Hechtsheim <-> Mz-Finthen)<br></br>
<a href=\"http://way/to/link/site.html\" target=\"_blank\">MVGmeinRad Station</a>",
"lat": 50.00158,
"lng": 8.20461,
"image": "marker_64_50_51_rad.png"
}
]
}Any ideas? Thanks for comments.
°° I hope you understand what I write. Cause I am german
°°
Schlischa
Offline
A update of my current jason data:
{
"places":[
{
"title":"Cafe Raab",
"description":"Café Raab",
"lat":50.0040,
"lng":8.2015,
"image":"marker_cafe.png"
},
{
"title":"Am Sportfeld",
"description":"<a href=\"http://way/to/link/site.html\" target=\"_blank\">MVGmeinRad Station</a>",
"lat":50.00477,
"lng":8.20110,
"image":"marker_radstation.png"
},
{
"title":"Kapellenstraße/Gesundheitszentrum",
"description":
[
"<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>",
"<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>",
"<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>"
],
"lat":50.00158,
"lng":8.20461,
"image":"marker_64_50_51_rad.png"
}
]
}So the marker and the infobox is show! Jeah
! But now, the comma after the <br></br>" is also displaying
. So my second and third link is named ",Buslinie 47 (...)" instead of "Buslinie 47 (...)" (note the comma
)
what do you think? If I delet the comma, my code is false and it´s shown nothing again.
Offline
did you try replacing the outer " (dblquot) by ' (simplequot) ? and , by + if I understand you wanna display
link1
link2
link3
'<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>'+ '<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>'+ '<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br></br>'
Last edited by mahieux06 (2012-06-28 12:50:42)
Offline
Sorry, don´t work
but thx for help ![]()
I wanna display:
link1 text
link2 text
link3 text
But I've got a good message. Know it works! The Code just have to be in one line!!! So here is the Code:
{
"places":[
{
"title":"Cafe Raab",
"description":"Café Raab",
"lat":50.0040,
"lng":8.2015,
"image":"marker_cafe.png"
},
{
"title":"Am Sportfeld",
"description":"<a href=\"http://way/to/link/site.html\" target=\"_blank\">MVGmeinRad Station</a>",
"lat":50.00477,
"lng":8.20110,
"image":"marker_radstation.png"
},
{
"title":"Kapellenstraße/Gesundheitszentrum",
"description":
[
"<a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim) <br /><br /><a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim)<br /><br /><a href=\"http://way/to/link/site.html\" target=\"_blank\">Buslinie 47</a> (Wiesbaden <-> Mz-Gonsenheim)"
],
"lat":50.00158,
"lng":8.20461,
"image":"marker_64_50_51_rad.png"
}
]
}
Offline
"description" shouldn't be an array
Offline
Pages: 1