• Resolved whenmapsattack

    (@whenmapsattack)


    Hi,

    I’m wondering if there is a way to limit how far users can pan, set an extent limit. I’m using custom TileMill/MapBox tiles and on another website using the tiles, I can dial in where users can pan.

    Can I do that with MapsMarker? If not, how do others with a small region of geographic tiles handle this? Is there a way for Google maps to show up once outside the custom region?

    Also, new to wordpress here, but am wondering if I can add my own javascript to the maps? I would also like to have a legend that can be turned on or off by user and have it change based on zoom level, like done here, https://baytrail.abag.ca.gov/baytrailmap.html

    Thanks,
    Tim

    https://www.ads-software.com/plugins/leaflet-maps-marker/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi Tim,
    what you are describing is currently not possible. Anyway with the next release (probably available on Thursday), it will be able to use the Leaflet API for maps as I will switch from random Javascript map IDs to persistent map IDs.
    best,
    Robert

    Thread Starter whenmapsattack

    (@whenmapsattack)

    Thanks for the info Robert.
    Great work.

    I don’t understand how to use javascript within a wordpress environment yet, but will take a look when you release it.

    Hi,
    v3.8.7 with the change described has been released – see https://mapsmarker.com/v3.8.7 for more details.
    best,
    Robert

    Thread Starter whenmapsattack

    (@whenmapsattack)

    Hi Robert or anyone else with great knowledge,

    I can’t seem to grasp how to affect the map.

    I figured out how to make javascript work. I got an alert to come up by pasting this in the footer

    <script type=”text/javascript”>
    alert(“hello world.”);
    </script>

    But I can’t seem to grab the map. Based on the explanation on mapsmarker.com, I was assuming since my layer is ID=2, that I would just change markermap_4.setZoom(21); to layermap_2.setZoom(21); I have tried every possible instance or variation (layer2.setZoom, layermap-2, layer_2, etc), but I can’t affect the map at all.

    Eventually I want to restrict panning to a set of boundaries which I should be able to figure out once I know how to control the map with javascript.

    Thanks,
    Tim

    Hi Tim,
    must be another issue – just tested it successfully on my dev server with the following code in the footer:

    <script type="text/javascript">
    layermap_2.setZoom(11);
    </script>

    Can you please post the link to the map?
    best,
    Robert

    Thread Starter whenmapsattack

    (@whenmapsattack)

    it seems like your update didnt work out well – in the source code it says you′re using 3.8.6, but the output of the js variable for the map is not layermap_2 but lmm_layermap_RANDOMNR

    please download the current package from https://www.ads-software.com/extend/plugins/leaflet-maps-marker/, overwrite all files on your webserver and try again.

    Please also be aware that on https://leafletjs.com/reference.html always the latests leaflet version is addressed. As the free version, uses an older version of leafet, some API commands will not work with the free version.
    best,

    Robert

    Thread Starter whenmapsattack

    (@whenmapsattack)

    Perfect, that did it.
    Thanks a bunch. I got my clients to get the Pro version for the custom logo and to keep up to date. I just wanted to do a little testing before I start adding javascript to their site.

    great to hear!

    BTW: if more of your clients need maps on their sites, you might be interested in joining the reseller programm. More infos at https://mapsmarker.com/resellers

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘limiting panning extents’ is closed to new replies.