POST
|
Robert - Thanks for the reply! First off, good catch on the declare statement. The sample code I uploaded was a simplified and stripped down version of the full file and clearly I messed up in translating the code over. I updated the code to ensure it matched API 3.32. The this._textGeometry now includes the reference to this.map.SpatialReference and the this._textGraphics object now uses the non-JSON constructor. No joy....still no text on the screen. When inspecting the layer within a Chrome browser, I see that the this._textLayer was created; however, it has a size of 0px x 0px. Also, when I console.log(this._textGraphic) and inspect the object (see info below) I see that the symbol was created, added to the graphic, and that the graphic was added to the layer. Any other things I'm missing? {_attrs: {�}, _url: null, url: null, spatialReference: {�}, initialExtent: {�},��} arcgisProps:�undefined attached:�true attributionDataUrl:�"" className:�undefined dataAttributes:�undefined graphics:�Array(1) 0: attributes:�{} geometry:�{x:�-118.65141125565243,�y:�35.26778599032485,�spatialReference:�{�}} infoTemplate:�undefined symbol: align:�"middle" color:�b.Color�{r:�255,�g:�0,�b:�0,�a:�1} font:�{size:�64,�weight:�"bold"} horizontalAlignment:�"center" kerning:�true rotated:�false text:�"Test" type:�"textsymbol" x:�0 xoffset:�0 y:�0 yoffset:�0 __proto__:�Object _constructed:�true _extent:�{xmin:�-118.65141125565243,�ymin:�35.26778599032485,�xmax:�-118.65141125565243,�ymax:�35.26778599032485,�spatialReference:�{�},��} _graphicsLayer:�{_attrs:�{�},�_url:�null,�url:�null,�spatialReference:�{�},�initialExtent:�{�},��} _layer:�{_attrs:�{�},�_url:�null,�url:�null,�spatialReference:�{�},�initialExtent:�{�},��} _sanitizeNumericValue:���() _suspended:�false __proto__:�Object length:�1 __proto__:�Array(0) hasAttributionData:�false id:�"text_lyr" infoTemplate:�undefined initialExtent:�{xmin:�-180,�ymin:�-90,�xmax:�180,�ymax:�90,�spatialReference:�{�},��} loaded:�true normalization:�true parentLayer:�undefined refresh:���() refreshInterval:�0 spatialReference:�{wkid:�4326} styling:�true suspended:�false url:�null visibleAtMapScale:�true webglEnabled:�true _acquireSVGMarker:���() _attrs:�{} _bgGroup:�{rawNode:�g,�shape:�a,�matrix:�null,�fillStyle:�null,�strokeStyle:�null,��} _div:�{rawNode:�g#text_lyr_layer,�shape:�a,�matrix:�null,�fillStyle:�null,�strokeStyle:�null,��} _draw:���() _errorHandler:���() _evalSurfaceTimerHandle:�null _evalSurfaceType:���() _inherited:�{p:�3,�c:��} _isRefLayer:�false _lineMarkers:�{} _lyrZEHandle:�{id:�8,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _map:�{_plugins:�{�},�_internalLayerIds:�Array(1),�_layers:�Array(0),�_layerDivs:�Array(0),�_basemapPending:�false,��} _mouseEvents:�true _onExtentChangeHandler_connect:�{id:�11,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _onPanEndHandler_connect:�{id:�6,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _onPanHandler_connect:�{id:�8,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _onPanStartHandler_connect:�null _onZoomStartHandler_connect:�{id:�5,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _onclick_connect:�{remove:��} _ondblclick_connect:�{remove:��} _onmousedown_connect:�{remove:��} _onmousemove_connect:�{remove:��} _onmouseout_connect:�{remove:��} _onmouseover_connect:�{remove:��} _onmouseup_connect:�{remove:��} _panDx:�-10.39996337890625 _panDy:�-2.399993896484375 _params:�{displayOnPan:�true,�drawMode:�true,�styling:�true,�id:�"text_lyr",�title:�"Labels"} _plugins:�{} _processEvent:���() _refresh:���() _resized:�false _resumedOnce:�true _rndForScale:�undefined _scheduledRefresh:���() _setMap:���(b) _setSurfaceType:���() _srInfo:�{wkTemplate:�"PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GE�R["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]",�valid:�Array(2),�origin:�Array(2),�dx:�0.00001} _svgFilters:�{} _url:�null _wakeTimer:�null _webglChangeMapHandle:�{id:�5,�receiveArguments:�true,�previous:�{�},�remove:��,�advice:��,��} _wrap:�true __proto__: constructor:���() declaredClass:�"esri.layers.GraphicsLayer" disableMouseEvents:���() enableMouseEvents:���() getInherited:���k(a,b,c) inherited:���d(a,b,c,d) isInstanceOf:���h(a) onClick:���() onDblClick:���() onMouseDown:���() onMouseDrag:���() onMouseMove:���() onMouseOut:���() onMouseOver:���() onMouseUp:���() __inherited:���d(a,b,c,d) _initLayer:���() _onClickHandler:���(a) _onDblClickHandler:���(a) _onMouseDownHandler:���(a) _onMouseDragHandler:���(a) _onMouseMoveHandler:���(a) _onMouseOutHandler:���(a) _onMouseOverHandler:���(a) _onMouseUpHandler:���(a) _processEvent:���(a) _setMap:���() _unsetMap:���() __proto__:
... View more
06-10-2020
11:29 AM
|
0
|
2
|
793
|
POST
|
I am attempting to add a TextSymbol to a map in Web AppBuilder; however, the text does not display on the map. When I inspect the <div> created for the text graphics layer, is shows 0 x 0. Additionally, when I inspect the this._textLayer in Chrome, it does not have anything listed under its graphics attribute. Any help would be greatly appreciated! define(['dojo/_base/declare', 'dijit/_WidgetsInTemplateMixin', 'esri/graphic', 'esri/Color', 'esri/geometry/Point', 'esri/layers/GraphicsLayer', 'esri.symbols/TextSymbol', 'esri/symbols/Font' ], function(declare, _WidgetInTemplateMixin, Graphic, Color, Point, GraphicsLayer, TextSymbol, Font) { var clazz = declare([BaseWidget, _WidgetsInTemplateMixin], { baseClass: 'please-help-solve', _textGeometry: null, _textSymbol: null, _textGraphics: null, _textLayer: null, postCreate: function() { this.inherited(arguments); // Creates graphics layer for the text this._textLayer = new GraphicsLayer({ id: 'text_lyr', title: 'Labels' }) this.map.addLayer(this._textLayer) // Creates the font, color, and textSymbol var myFont = new esri.symbol.Font() myFont.setSize("12pt") myFont.setWeight(Font.WEIGHT_BOLD) var myColor = new Color([255,0,0]) this._textSymbol = new TextSymbol("TEST", myFont, myColor) // Creates the geometry, graphic, and adds it to the layer this._textGeometry = new Point(this.map.extent.getCenter().getLongitude(), this.map.extent.getCenter().getLatitude()) this._textGraphics = new Graphic({ geometry: this._textGeometry, symbol: this._textSymbol, attributes: {} }) this._textLayer.add(this._textGraphics) } }) } )
... View more
06-07-2020
08:18 AM
|
0
|
5
|
891
|
POST
|
Mark - thanks for the reply. I must have looked at the table a dozen times yesterday and missed the fact that each app type (2D vs 3D) is the differentiating factor between the JS API versions. Again, thanks for pointing that out. In further troubleshooting it last night I started to notice I was only receiving 404 errors for modules that had changed between v3 and v4. For example, I was receiving the error for the IdentityManager module. Once I did a find all / replace and updated the path to the new esri/identitiy/IdentityManager path (vice the original esri/IdentityManager path), the error went away. Not sure what side impacts this has "under the hood" though. As I'm working on a 2D app, looks like I will have to roll back to v3.31 of JS API. I'd be curious if Esri plans to change the WAB baseline completely over to v4.
... View more
05-07-2020
07:20 AM
|
0
|
1
|
532
|
POST
|
I'm currently developing in WAB v2.15. I'm trying to use JS API v4.14 instead of the default v3.31. I followed the instructions here; however, after changing the apiVersion to 4.14 (either by un-commenting the "apiUrl = 'https://js.arcgis.com/4.14'" line or changing the apiVersion variable to 4.14) within the env.js file I cannot get WAB to load. When inspecting the code, I see I am receiving the following error: "GET https://js.arcgis.com/4.14/esri/XXXXX.js net::ERR_ABORTED 404". What am I doing wrong?
... View more
05-06-2020
06:52 PM
|
0
|
3
|
607
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|