Copied to clipboard

Flag this post as spam?

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


  • Eric Boen 40 posts 64 karma points
    Aug 31, 2012 @ 04:01
    Eric Boen
    0

    Retrieving Lat, Long Zoom from Razor

    Hi,

    How do you get the coordinates from razor?  

    Thanks

    Eric

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Sep 01, 2012 @ 16:51
    Jan Skovgaard
    2

    Hi Eric

    You should be able to access the maps property like you would access any other value using Razor.

    In order to get extract the coordinates and zoom level you should be able to do something like this:

    @{
      var map @Model.map;
      var lat map.Split(',')[0];
      var lng map.Split(',')[1];
      var zoom map.Split(',')[2];
      }

    <p>@map</p>
    <p>@lat</p>
    <p>@lng</p>
    <p>@zoom</p>

    Hope this helps you.

    /Jan

  • Eric Boen 40 posts 64 karma points
    Sep 04, 2012 @ 01:45
    Eric Boen
    0

    Thanks Jan.  I'm an idiot, I did't click the bubble on the map to choose the location so my values were null.

    Thanks

    Eric

Please Sign in or register to post replies

Write your reply to:

Draft