Google map api marker url not able to resolve url correct

Hi Friends,

I am using below code to get click url on marker, but it opens up url with mydomain/url which is wrong.
I want only URL to open. How to get solve this?

var point = new google.maps.LatLng(<?php echo $marker['lat'] ?>,<?php echo $marker['long']?>);
				var marker = new google.maps.Marker(
					{
					position:point, 
					map:map,
					title:'<?php echo $marker['desc']?>',
					url: '<?php echo $marker['url']?>',
					draggable:true,
					
					}
					
				);

Hi, ankit.

I can see that there is code posted, but I can’t see some of it… it looks the same to me as it does to you. :smile:

Please edit your post and add three backticks on a line by themselves before the code and three backticks on a line by themselves after the code. Like this:

```
your code here
```

That will allow the code to remain formatted and visible to everyone.

Thank you.

I’ve formatted it properly now :smile:

1 Like

What’s in $marker[‘url’] ?

Thanks buddy

Hi Droopsnoot,

Its array for table and URL is column which has site address. I am fetching URL from DB Table.

But problem is when I click on marker map it opens with my domain/url

I really meant can you show an example of exactly what is in one of the URL fields.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.