-
AuthorPosts
-
February 20, 2017 at 7:31 pm #1012276
Hello, when i show a group of items on the map, the map is center on the lat/long coordinates of the last item of the list. For example in
http://ninoiorfino.it/catalogo/operatori you can see a random list of items and every time you reload the page the map change its center according to the last item’s coordinates. The problem is that this rule cause some items go out of the frame so they are not showed unless you manually adjust the center of the map. The solution could be to have a default point for the map center. How can i get it? Regards NinoSaguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
February 21, 2017 at 9:12 am #1012468Hi Nino,
Could you provide the Admin & FTP account of your site so we can take a look?
Regards
February 21, 2017 at 3:49 pm #1012602This reply has been marked as private.Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
February 22, 2017 at 9:58 am #1012824Hi.
The Map should be ok now.
Edit the file
plugins/system/jagooglemap/assets/script.jsAdded these
var _bounds = new google.maps.LatLngBounds();
_bounds.extend(new google.maps.LatLng(latitude, longitude));
this.objMap.fitBounds(_bounds);
February 23, 2017 at 7:34 am #1013023yes, it could be a possible solution, the map zoom change on the quantity of items to allow to see all of them. But in case of only one item -or 2 or 3 items to close each other- the zoom is too deep, at the street level and at a first look is difficult to understand which is the town. So it could be better to mantain the default zoom at the same level showing the full Sardinia island in every search result. Any suggest how to do it?
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
February 27, 2017 at 4:46 am #1013775Hi.
Added this code to the same file.
var __zoom = 17; if (_numberloccation<2) { google.maps.event.addListenerOnce(this.objMap, 'bounds_changed', function(event) { this.setZoom(__zoom); }); }
You can change the zoom from 17 to any number you like from 1-20 but don’t forget that if the zoom too much when you have more than 1 marker and the zoom will break so I include this condition to check and utilize the zoom when have 1 marker only.
if (_numberloccation<2) {
February 27, 2017 at 10:59 am #1013883Hi, now show only the first marker of the item’s list, all the other items are not visible on the map.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
February 28, 2017 at 3:33 am #1014027My bad, there was mistake in Javascript, It’s ok now. Kindly check.
southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 18, 2017 at 2:22 pm #1057221what was the mistake in the javascript? Can you rewrite the code here?
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
August 22, 2017 at 2:55 am #1057806Hi,
Unfortunately it’s been months since I fixed this so right now it’s not possible for me to recall the mistake back then.
If you still need my help with anything else, pls let me know.
southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 22, 2017 at 7:45 am #1057883Yes Moonlight my situation is a little different, there are other maps in the same Joomla site that I would like to remain the same. It is only the map on the africa.southsouthworld.org I would like a specific location to be the center of the map. Please kindly advise the best solution to this. Many thanks in advance.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
August 24, 2017 at 3:52 am #1058317Hi. southsouthworld
If you had problem please create new topic.
And share site link and admin info so i could make a closer check.southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 29, 2017 at 11:38 am #1059186New topic created Moonlight. 🙂
-
AuthorPosts
This topic contains 12 replies, has 4 voices, and was last updated by southsouthworld 7 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum