Copied to clipboard

Flag this post as spam?

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


  • Damon 217 posts 288 karma points
    Dec 07, 2015 @ 11:25
    Damon
    0

    How do you access the latitude and longitude in Google Maps DataType?

    Hi,

    I am using Google Maps DataType. Why is there no documentation about how to use it?

    When I write the maps field out to the page it just displays GMapsLocation.

    How do you access the map information from this? I assume you have to get the latitude and longitude and then use the normal Google API to generate the map? Is this correct?

    Thanks a lot for any info!

  • Alex Skrypnyk 6147 posts 24056 karma points MVP 8x admin c-trib
    Dec 07, 2015 @ 11:55
    Alex Skrypnyk
    0

    Hi Damon,

    What version of Umbraco are you using ? this datatype - https://our.umbraco.org/projects/backoffice-extensions/google-maps-datatype ?

    Thanks, Alex

  • Damon 217 posts 288 karma points
    Dec 07, 2015 @ 12:16
    Damon
    0

    Hi Alex,

    It is 7.2.4. I know it is only officially tested up till 6. Will it work with 7? It still does not seem to explain how to use it. Thanks

  • Alex Skrypnyk 6147 posts 24056 karma points MVP 8x admin c-trib
    Dec 07, 2015 @ 12:47
    Alex Skrypnyk
    0

    Damon, usually, we are using this one - https://our.umbraco.org/projects/backoffice-extensions/angulargooglemaps/

    It's pretty easy to use it:

    1. Install package.
    2. Create a new data type using the new Angular Google Maps property editor. Has Six options:- a. Default location – set a default location for map b. Map Height – Set the height of the Google map in pixels c. Hide Search – Decide whether to display a Search box to content editor d. Hide Label – Decide whether the Map takes up all the space of the editor
      e. Hide, show or allow the selected coordinates to be displayed and / or editable f. Marker Icon - Select an image to use as the map marker Can select either from a predefined list of 95 of Google's latest map icons or any custom image with an absolute or relative Url

    3. Add new data type to document type

    4. Create new content based on document type

    Type Convertor Dynamic convertor works straight out of the box now, converts property string to AngularGoogleMaps.Model type which contains 3 properties (Latitude, Longitude and Zoom)

    In a razor page with an AGM property named Map @{ var lat = CurrentPage.Map.Latitude; var lng = CurrentPage.Map.Longitude; var zoom = CurrentPage.Map.Zoom; }

    Strongly Typed convertor converts any AGM PropertyValue to AngularGoogleMaps.Model

    In a razor page with an AGM property with alias map @{ var map = Model.Content.GetPropertyValue

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to:

Draft