Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Robert Seyfriedsberger

    (@harmr)

    Hi Sascha,

    the map-id is a random number and is needed as a shortcode can be used more than once on a site and otherwise the second map would break. I already tried once to change this to a constant number but failed (will try again ??

    With the next release I will add additional classes to the map div, which at least allow better css styling for individual maps. The classes will be e.g. mapsmarker markermap marker-1
    best,

    Robert

    Thread Starter landwire

    (@landwire)

    Ah, yes, was coming to the random number conclusion too! So is there no way that I can access the map from “outside” to change it’s zoom etc for now I assume. Or could I map (as reference maybe) that variable to another variable that increments everytime the shortcode is called?

    Like markermap_1 = lmm_map_9748caac; markermap_2 = lmm_map_5647bhhb; layermap_1 = lmm_map_9836hgdf etc for each map that is displayed/created on that page.

    then I could call layermap_1.setView(new L.LatLng(8.407168, 19.687500), 4); and it should not conflict with any other of your code. No idea if that would work in javascript though?!?

    Anyway, it’s not that crucial for now, though would be nice to be able to access zoom and pan. Use case:
    Layermap:
    Restaurant Site -> shows all restaurant in Germany on a map
    I want to see restaurants in Berlin-Kreuzberg -> map zooms to Berlin-Kreuzberg
    S

    Plugin Author Robert Seyfriedsberger

    (@harmr)

    with random number as ID I dont currently see a way to access e.g. zoom and pan with custom JS – will have a look if this can be changed, as it would be a useful feature, anyway this is going to be tricky…

    Thread Starter landwire

    (@landwire)

    Maybe the random number as ID could be part of the shortcode? So if ID is specified then instead of the random number the ID is used as the variable name and ID of the map maybe.

    Like [mapsmarker layer=”1″ id=”my_map”]

    As long as people know that they cannot have maps with the same id on the same page. That would leave all normal shortcodes [mapsmarker layer=”1″] working, but only change the behaviour/id when people actually know what they are doing.
    S

    Plugin Author Robert Seyfriedsberger

    (@harmr)

    Hi Sascha,
    I think I know how to do it: leave the randomID for html-divs and use persistend javascript variable names with follow a structure (like markermap_1, layermap_2…). Will also make variable names controls for control persistens so that they can be used for advanced customizations easier.
    thx again for the feedback! (do you already have a user at https://mapsmarker.com/login ? would like to assign you a pro license as a thank you for your valuable feedback)
    best,
    Robert

    Thread Starter landwire

    (@landwire)

    Nice that you maybe found a solution! Let me know when you get it to work.

    And that is very kind of you to offer a pro licence! Cannot wait to try some pro features out – though now some other tasks have priority over the next few days! I do not have an account on mapsmarker.com. Shall I create one?
    S

    Plugin Author Robert Seyfriedsberger

    (@harmr)

    yes, please register for a free trial and let me know your email (mapsmarker.com/contact) so that I can assign your user the license…

    Thread Starter landwire

    (@landwire)

    Hello Robert,
    well a few days turned into nearly a year! Finally it is time to “attack” the map functionality again. I have not looked at it since 11 months ago! Would you still be willing to assign me a pro licence? That would be great, so I can right away get started on the “real thing”.

    Best regards and I hope you have kept well the past year,
    Sascha

    Hi Sascha,
    of course – just register a free 30 days pro trial, send me a short email (info mapsmarker com) afterwards and I will assign your user a pro license…
    best,
    Robert

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Change map zoom and center after map is loaded’ is closed to new replies.