Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lars-Erik Aabech 349 posts 1100 karma points MVP 7x c-trib
    May 10, 2017 @ 11:07
    Lars-Erik Aabech
    0

    Zooming to bounding box and optionally accessing the map objects

    Hi,

    We've been happily flushing out nodes on a map with the nice Terratype() html helper. However, we'd like more control over the zoom level - that is to set the current zoom to the bounding box of n hits from a search.

    We didn't spot any obvious way to do this, so we set about hacking our way to the Google API Map object(s), but alas the closure is so (well) welded tight that it's difficult to expose them via the DOM. (Due to defer, we can't run scripts at the right time)

    Any way to get the bb-zoom already?
    And would you consider adding some kind of event/port we can extend the map behaviour from?

    (Time passed...)

    We're currently making a Mercator projection serverside - think it'll work. But there's a huge opportunity for extensions here. ;)

    Regards, Lars-Erik

  • Jonathan Richards 288 posts 1742 karma points MVP
    May 10, 2017 @ 11:14
    Jonathan Richards
    0

    Hey Lars

    Great idea, yeah, I'm always keen to hear ideas. This one I like a lot, and can see many wanting it. plus, and this is my own interests, but I like ideas that effect all map providers and not ones that just benefit Google Maps for example.

    Consider this on my to-do list, I can't promise anything in the short term, but when I find myself with a free day.

    Cheers

    Jonathan

  • Lars-Erik Aabech 349 posts 1100 karma points MVP 7x c-trib
    May 10, 2017 @ 11:46
    Lars-Erik Aabech
    1

    Cool,

    We'll paste the solution here if we find a viable one.

    L-E

  • Geoff Beaumont 75 posts 104 karma points
    Nov 15, 2017 @ 20:20
    Geoff Beaumont
    1

    Fitting to a bounding box is definitely something that would make Terratype massively more useful - it's something I commonly need to do, and with no access to the provider's native API it's impossible to work around.

  • Jonathan Richards 288 posts 1742 karma points MVP
    Jan 07, 2018 @ 18:45
    Jonathan Richards
    0

    New version 1.0.15 now contains an AutoFit field in Options that automatically will re-centers and selects the appropriate zoom level required to show all map icons at once.

  • Geoff Beaumont 75 posts 104 karma points
    Jan 08, 2018 @ 09:33
    Geoff Beaumont
    0

    Fantastic - thanks Jonathan!

Please Sign in or register to post replies

Write your reply to:

Draft