Copied to clipboard

Flag this post as spam?

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


  • Jeroen Oostwouder 100 posts 296 karma points
    Nov 29, 2018 @ 13:45
    Jeroen Oostwouder
    0

    Getting API Key manualy

    Is it possible to retrieve the API-key from the property-editor? Or even better, can I make Terrartype return the full JS-link with API-key?

    I don't want to use @Html.Terratype. It's very slow somehow, and sometimes I need a bit more control (multiple markers, or clustering).

    But at this point, I'm entering a API-key in the propertyeditor, but also in a config-location (web.config or a config-node). If Terratype could return the API key, it's one config-setting less.

  • Jonathan Richards 288 posts 1742 karma points MVP
    Nov 29, 2018 @ 14:49
    Jonathan Richards
    100

    Hi Jeroen,

    Its part of the Terratype.Models.Model and you can get it easily, once you have cast the Provider property to GoogleV3 provider type.

    In Razor, if you knew the map was a Google V3 map, you could use this to output it.

        @((Model.Content.Map.Provider as Terratype.Providers.GoogleMapsV3).ApiKey)
    

    Cheers

    Jonathan

  • Jeroen Oostwouder 100 posts 296 karma points
    Nov 29, 2018 @ 14:51
    Jeroen Oostwouder
    0

    Hi Jonathan,

    thank you for the quick response. That will save some time.

Please Sign in or register to post replies

Write your reply to:

Draft