Info window diplaying one above another

Phoca Maps - displaying maps in Joomla! CMS
sd12013
Phoca Member
Phoca Member
Posts: 18
Joined: 21 Jul 2011, 01:53

Re: Info window diplaying one above another

Post by sd12013 »

FWIW, I found this in the Google Maps API but I don't know the proper syntax or where to implement it (I think the phocomapsmap.php file around line 382?):
If you only want one info window to display at a time (as is the behavior on Google Maps), you need only create one info window, which you can reassign to different locations or markers upon map events (such as user clicks).
Create one InfoWindow object just after you initialize your map, and then handle the click event handler as follows:

Code: Select all

google.maps.event.addListener(curMarker, 'click', function() {
   infowindow.setContent(contentString);
   infowindow.open(map, curMarker);
});
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Info window diplaying one above another

Post by Jan »

Ok, thank you for the info.


Jan
If you find Phoca extensions useful, please support the project
goalexa
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 09 Mar 2012, 17:47

Re: Info window diplaying one above another

Post by goalexa »

I have the same problem. I have Joomla1.5.25, phoca Maps v.1.1.2, plugin v.1.1.0 and I want that first marker was closed at the opening of the second. How can I do it? Unfortunately the problem is still relevant :/

Thank You
olivJpc
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 17 Feb 2012, 16:12
Location: France
Contact:

Re: Info window diplaying one above another

Post by olivJpc »

sd12013 wrote:FWIW, I found this in the Google Maps API but I don't know the proper syntax or where to implement it (I think the phocomapsmap.php file around line 382?):
If you only want one info window to display at a time (as is the behavior on Google Maps), you need only create one info window, which you can reassign to different locations or markers upon map events (such as user clicks).
Create one InfoWindow object just after you initialize your map, and then handle the click event handler as follows:

Code: Select all

google.maps.event.addListener(curMarker, 'click', function() {
   infowindow.setContent(contentString);
   infowindow.open(map, curMarker);
});
I've got the same problem.
I'm a newbie but I can try for everybody this code if someone tell me in wich file we can put this code.
I don't have phocamapsmaps.php file. Maybe it's because I'm using the last phocamaps version in Joomla 1.5.25?
Thanks to all, we'll do it!
StreamAlex
Phoca Member
Phoca Member
Posts: 10
Joined: 02 Mar 2011, 09:13

Re: Info window diplaying one above another

Post by StreamAlex »

Any solution to this yet?

I have been digging in geoxl3.js file in com_phocamaps/assets/js. On line 305 you have

Code: Select all

google.maps.event.addListener(marker, 'click', function() {
So it must be the place where to put the code. But I cant figure out how to make it work.
StreamAlex
Phoca Member
Phoca Member
Posts: 10
Joined: 02 Mar 2011, 09:13

Re: Info window diplaying one above another

Post by StreamAlex »

Maybe this could be a help to anyone? http://stackoverflow.com/questions/2946 ... infowindow
Post Reply