Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • iorfino Friend
    #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 Nino

    Saguaros Moderator
    #1012468

    Hi Nino,

    Could you provide the Admin & FTP account of your site so we can take a look?

    Regards

    iorfino Friend
    #1012602
    This reply has been marked as private.
    Mo0nlight Moderator
    #1012824

    Hi.

    The Map should be ok now.

    Edit the file
    plugins/system/jagooglemap/assets/script.js

    Added these

    var _bounds = new google.maps.LatLngBounds();
    _bounds.extend(new google.maps.LatLng(latitude, longitude));
    this.objMap.fitBounds(_bounds);
    iorfino Friend
    #1013023

    yes, 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 Moderator
    #1013775

    Hi.

    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) {
    iorfino Friend
    #1013883

    Hi, now show only the first marker of the item’s list, all the other items are not visible on the map.

    Mo0nlight Moderator
    #1014027

    My bad, there was mistake in Javascript, It’s ok now. Kindly check.

    southsouthworld Friend
    #1057221

    what was the mistake in the javascript? Can you rewrite the code here?

    Mo0nlight Moderator
    #1057806

    Hi,

    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 Friend
    #1057883

    Yes 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 Moderator
    #1058317

    Hi. southsouthworld

    If you had problem please create new topic.
    And share site link and admin info so i could make a closer check.

    southsouthworld Friend
    #1059186

    New topic created Moonlight. 🙂

Viewing 13 posts - 1 through 13 (of 13 total)

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