Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>don't try this on a working application or one thats in production make a new map somewhere local server different test program whatever. </p> <p>PANING google maps has always been buggy especially around the edges or close to any of the google icons for pan zoom etc .</p> <p>you need to get back to basics forget functions and scripting just ask simple IF statements </p> <p>similar to this CAN'T REMEMBER WHAT I DONE A COUPLE OF YEARS AGO bit the gist is this.</p> <p>1) store 4 variables to represent four lines on a map </p> <p>left edge west right edge east top edge north bottom edge south</p> <p>another to keep track of centre LAT LNG( the start centre same as first map displayed on load ) </p> <p>i,e if you pan left or west by X you make the centre / center (for americans) equal to current centre by plus the pan X ditto for all the other pan directions add or subtract the required latitudes and longitudes </p> <p>test that you have not reached an edge (minus whatever by test trial and error) amount causes the google bug to appear close to icons around edge</p> <p>or put another way make the LAT's and LNG's you are testing for to be smaller that the displayed map</p> <p>if left or west edge of displayed map is at longitude x stop panning (by not doing anymore adjustments s to your centre VARIABLE at X - 10 longitudes same for all other 3 edges by plus or minus the required amount</p> <p>top edge north will will at lattitude a bottom edge south will be at lattitude a - whatever you chose</p> <p>left edge west will be at longitude b right edge east will be at longitude b- whatever you chose </p> <p>they will all be within the displayed map but say 0.5 of a latitude or longitude than displayed map </p> <p>if your pan crosses any of your fine lines set you centre var back or forward and you pan back or forward by say 0.1 to o.5 of a latitude or longitude viewers will just see a slight jerk back into place when they pan outside your pre de=fine four lines across the map.</p> <p>Code will like like very basic learner code but it will work.</p> <p>at least it did for me after some trial and error and the usual debugging typo errors etc.</p> <p>taking this approach you are in control and not google scripts that may have undocumented code in them that causes the problems your experiencing because google cannot know what your trying to achieve only you know that.</p> <p>SORRY HAVE NOT GOT THE CODE ANYMORE its not difficult just looks like newbie code and not the code advanced users prefer </p> <p>it's like making a simple learner program where if you move up or down or diagonally you adjust centre LAT LNG in you var thats store current centre (this is your own variable not a google variable ) if centre (stored in your own variable ) crosses one of your lines stop panning and set Gmap center back forward up or down by a little thats plus or minus a fraction of a LAT or LNG</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload