OS Property support center

Zoom for google map in Locator Search

More
10 years 7 months ago #36417 by Qtal
where is the google zoom for layout: Locator Search?

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #36428 by Mr. Dam
Replied by Mr. Dam on topic Re: Zoom for google map in Locator Search
Hi,
In locator Search, we don't have the default google zoom pre-defined, because the system will auto-adjust the zoom level of on the map to make all the properties can be seen on the Google map.
Thanks
Dam

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36957 by Zucom
Replied by Zucom on topic Re: Zoom for google map in Locator Search
I've been looking for an answer to this as sometimes we only have one property in a category and the map just shows a grey screen as the zoom level is 1.

Is there an override?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36962 by Mr. Dam
Replied by Mr. Dam on topic Re: Zoom for google map in Locator Search
Hi,
The map in OS Property will adjust the zoom level automatically depend on number properties and distance between them. So we can't setup the zoom level for each case. Even we have 1 property in the map
Thanks
Dam

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36968 by Zucom
Replied by Zucom on topic Re: Zoom for google map in Locator Search
Thanks for the reply/

There must be a way to set a minimum zoom in the files/code. You can see the problem we are having below:

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36970 by Mr. Dam
Replied by Mr. Dam on topic Re: Zoom for google map in Locator Search
Hi,
In fact, you can change the zoom level in Google map that having 1 property.
Please follow these steps:
1. Open file
components > com_osproperty > helpers > googlemap.lib.php
2. find
map.fitBounds(bounds); line 515
and add code:

var listener = google.maps.event.addListener(map, "idle", function() {
if (map.getZoom() > 16) map.setZoom(16);
google.maps.event.removeListener(listener);
});


bellow that line
Good luck
Dam

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36971 by Zucom
Replied by Zucom on topic Re: Zoom for google map in Locator Search
Thanks again for the reply but it white screens the web site. In my googlemap.lib.php line 515 is:

var bounds = new google.maps.LatLngBounds();

I have searched for map.fitBounds(bounds); and it is on line 633 and 1029.

I have tested by pasting the code below 515, 633 and 1029 and on 633 I have also pasted below the } which is on line 635.

Are you looking at the same version as me?

OSProperty 2.3.

Thanks.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36972 by Mr. Dam
Replied by Mr. Dam on topic Re: Zoom for google map in Locator Search
Hi,
Please copy source code in code.txt and replace in google.lib.php
Thanks
Dam
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36973 by Zucom
Replied by Zucom on topic Re: Zoom for google map in Locator Search
I've tried it but I get a white screen for the whole site.

Any other ideas?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #36974 by Mr. Dam
Replied by Mr. Dam on topic Re: Zoom for google map in Locator Search
If you have the backup file of google.lib.php, please remove it or please do not put it in the same folder with modified file.
Thanks
Dam

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan