Copied to clipboard

Flag this post as spam?

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


  • John Bergman 483 posts 1132 karma points
    Jun 01, 2017 @ 03:09
    John Bergman
    1

    Equalize vertial positioning of map

    When using the Nested Component to assembly maps, can the map position itself so that the distance from the top pin and the bottom pin and the edge are more equal? Right now, it pushes the lowers pin to the very bottom edge of the map.

    enter image description here

  • Jonathan Richards 288 posts 1742 karma points MVP
    Jun 01, 2017 @ 12:55
    Jonathan Richards
    0

    Hi John,

    What I see:

    A google map with 4 map markers in a mapset with the first map marker located in Lake Texoma which is defining the starting location and zoom

    Currently you can specify a starting location and zoom level for a map using the Options class in the @Html.Terratype()

    Like (Render example 5 from the docs)

        @Html.Terratype(new Options
        {
            MapSetId = 2,
            Zoom = 5,
            Position = new Terratype.CoordinateSystems.Wgs84("-30,130")
        })
    
        @foreach (var record in Model.Content.Nested)
        {
            var name = record.GetPropertyValue<string>("mapName");
            var map = record.GetPropertyValue<Terratype.Models.Model>("map");
    
            @Html.Terratype(new Options { MapSetId = 2 }, map,
                @<text>
                    @name is at @map.Position
                </text>
            )
        }
    

    Sadly there is no automated way to allow the map to auto locate & zoom, so that all the icons fit nicely on the map yet. This is on the roadmap of things I plan to write, and has been requested as a feature already

    If I had to state a timeline for this, It would be in the next few months or so.

    Cheers

    Jonathan

  • John Bergman 483 posts 1132 karma points
    Jun 02, 2017 @ 06:51
    John Bergman
    0

    What about an option to use the positioning/zoom of the first map for the full set, rather than centering of the first pin marker?

  • Jonathan Richards 288 posts 1742 karma points MVP
    Jun 02, 2017 @ 08:15
    Jonathan Richards
    0

    Yes, agreed, that is the feature that is being requested. It is on the roadmap.

    https://coderwall.com/p/hojgtq/auto-center-and-auto-zoom-a-google-map

  • Comment author was deleted

    Aug 14, 2017 @ 14:33

    +1 on the bounds. So far I like the package but I'm probably gonna have to do the rendering manually.

    Google Maps allows to set the bounds\viewport based on the markers and that would be a must-have option for me.

    Anyways, good work on the package. I'll use for the editor 'selecting' the marker, but for now; i'll be rendering it manually.

Please Sign in or register to post replies

Write your reply to:

Draft