0

The following is my code sample-

I tried rendering the map using the Picture Marker Symbol(as used in the example) and it works pretty well but if I use TextSymbol as mentioned in the documentation inside Graphic object, the application fails with the error saying TypeError: Cannot read property 'setTransform' of undefined and u is undefined. Can someone help me with what I'm doing wrong? Using Text Symbol Using Picture Marker Sumbol

    let mapProperties: any = {
        basemap: "streets",
        ground: "world-elevation"
      };

      let map: any = new Map(mapProperties);
      let constructMap = function (lat, long, popupTemplate) {
        var point = new Point({
          longitude: lat,
          latitude: long
        });
        var markerSymbol = new PictureMarkerSymbol({
          url: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png",
          width: "25px",
          height: "41px"
        });


        var textSym = new TextSymbol({
          text: "Sample Text"
        });
        console.log(textSym, markerSymbol);
        var pointGraphic = new Graphic({
          geometry: point,
          symbol: markerSymbol,
          popupTemplate: popupTemplate
        });
        var a = new MapView(mapViewProperties);

        a.graphics.add(pointGraphic);
  • Cross-posted as https://gis.stackexchange.com/q/243251/115 – PolyGeo Jun 09 '17 at 06:58
  • Where do you define your TextSymbol, are you sure it points to esri/symbols/TextSymbol? Verify the order of the modules in your define, it must match the order of your function parameters exactly. – greenkarmic Jun 12 '17 at 20:15
  • @greenkarmic You were right, my imports were not in the correct order. Thank you so much for the help, pity yours is a comment and not an answer. – Sushant Dahiya Jun 23 '17 at 13:56

1 Answers1

2

Verify the order of the modules in your define, it must match the order of your function parameters exactly.

greenkarmic
  • 429
  • 4
  • 17