Copied to clipboard

Flag this post as spam?

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


  • Farid Mustafayev 6 posts 117 karma points
    Sep 12, 2018 @ 17:20
    Farid Mustafayev
    0

    Terratype Map render error - Cannot read property 'position' of null

    Hi there,

    I have an issue with rendering of Terratype GoogleMapsV3.

    Umbraco version 7.12.2 assembly: 1.0.6820.12881

    After installation and adding that into page I have faced with console error:

    Uncaught TypeError: Cannot read property 'position' of null
    at Object.load (Terratype.GoogleMapsV3.Renderer.js?cache=1.0.20:193)
    at Object.init (Terratype.GoogleMapsV3.Renderer.js?cache=1.0.20:25)
    at root.TerratypeGoogleMapsV3CallbackRender (Terratype.GoogleMapsV3.Renderer.js?cache=1.0.20:524)
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:97
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:67
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:64
    at Array.<anonymous> (js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:67)
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:138
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:67
    at js?v=3&libraries=places&callback=TerratypeGoogleMapsV3CallbackRender&key=AIzaSyAPh_B9G4SkwnCb48B-kZa8rpl2uAQvl_I:138
    

    And the configuration JSON file is here:

    {
      "config": {
        "height": 400,
        "gridHeight": 400,
        "debug": "2",
        "icon": {
          "id": "redmarker",
          "url": "https://mt.google.com/vt/icon/name=icons/spotlight/spotlight-poi.png",
          "size": {
            "width": 22,
            "height": 40
          },
          "anchor": {
            "horizontal": "center",
            "vertical": "bottom"
          }
        },
        "label": {
          "enable": false,
          "editPosition": "0",
          "id": "standard"
        },
        "provider": {
          "id": "Terratype.GoogleMapsV3",
          "version": 3,
          "forceHttps": true,
          "language": "",
          "predefineStyling": "retro",
          "showRoads": true,
          "showLandmarks": true,
          "showLabels": true,
          "variety": {
            "basic": true,
            "satellite": false,
            "terrain": false,
            "selector": {
              "type": 1,
              "position": 0
            }
          },
          "streetView": {
            "enable": false,
            "position": 0
          },
          "fullscreen": {
            "enable": true,
            "position": 0
          },
          "scale": {
            "enable": false,
            "position": 0
          },
          "zoomControl": {
            "enable": true,
            "position": 0
          },
          "panControl": {
            "enable": false
          },
          "draggable": true,
          "grid": {
            "enable": false
          },
          "styles": [
            {
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#ebe3cd"
                }
              ]
            },
            {
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#523735"
                }
              ]
            },
            {
              "elementType": "labels.text.stroke",
              "stylers": [
                {
                  "color": "#f5f1e6"
                }
              ]
            },
            {
              "featureType": "administrative",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#c9b2a6"
                }
              ]
            },
            {
              "featureType": "administrative.land_parcel",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#dcd2be"
                }
              ]
            },
            {
              "featureType": "administrative.land_parcel",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#ae9e90"
                }
              ]
            },
            {
              "featureType": "landscape.natural",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "poi",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "poi",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#93817c"
                }
              ]
            },
            {
              "featureType": "poi.park",
              "elementType": "geometry.fill",
              "stylers": [
                {
                  "color": "#a5b076"
                }
              ]
            },
            {
              "featureType": "poi.park",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#447530"
                }
              ]
            },
            {
              "featureType": "road",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#f5f1e6"
                }
              ]
            },
            {
              "featureType": "road.arterial",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#fdfcf8"
                }
              ]
            },
            {
              "featureType": "road.highway",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#f8c967"
                }
              ]
            },
            {
              "featureType": "road.highway",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#e9bc62"
                }
              ]
            },
            {
              "featureType": "road.highway.controlled_access",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#e98d58"
                }
              ]
            },
            {
              "featureType": "road.highway.controlled_access",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#db8555"
                }
              ]
            },
            {
              "featureType": "road.local",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#806b63"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#8f7d77"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "labels.text.stroke",
              "stylers": [
                {
                  "color": "#ebe3cd"
                }
              ]
            },
            {
              "featureType": "transit.station",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "water",
              "elementType": "geometry.fill",
              "stylers": [
                {
                  "color": "#b9d3c2"
                }
              ]
            },
            {
              "featureType": "water",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#92998d"
                }
              ]
            }
          ],
          "apiKey": "#######################################"
        },
        "search": {
          "enable": 2,
          "limit": {
            "countries": [
              "DK"
            ]
          }
        },
        "grid": {
          "enable": true,
          "name": "Contact Us Map"
        }
      },
      "position": {
        "id": "WGS84",
        "precision": 6,
        "datum": "50.42264,30.505985"
      },
      "zoom": 16
    }
    

    And in the html markup the following: Markup

    But nothing displays on the page. Just empty and collapsed place of the map. Do you have any ideas?

  • Farid Mustafayev 6 posts 117 karma points
    Sep 18, 2018 @ 13:39
    Farid Mustafayev
    101

    It looks issue was related with Terratype.dll installation from NuGet.

    So, in the beginning I have added Terratype as a package from Developer section in CMS admin, everything worked ok. Then I deployed my changes to Azure and it showed an error in the line "@using Terratype;" that missing library, etc. That's why I have installed Terratype through NuGet directly to Visual Studio project. During installation it asked to overwrite existing files, but I chose "No for all" (Probably this was my issue). Deployed again to Azure and error disappeared. I didn't look at the page with Terratype Google Maps, but later on I found that id doesn't display there.

    I have completely forgot about NuGet installation.

    Now I have created completely new Umbraco solution and installed everything like before, but chose "Yes for all" during NuGet installation, so it works now.

Please Sign in or register to post replies

Write your reply to:

Draft