|
POST
|
In flex, I was able to create a context menu and a tooltip (infotemplate) for the same point on a gL. It seems that in JS is either one or the other. If I script out the infotemplate, the context menu appears, otherwise I will see the tooltip only. so can they coexist? ----------------------------- this.createcontextmenu(); this.setinfotemplate(); on(myGraphicsLayer, 'mouse-over', lang.hitch(this, function (event) { this.map.graphics.clear; var graphic = event.graphic; if (graphic.attributes.name === "my point") { this.map.infoWindow.setFeatures([graphic]); this.map.infoWindow.setContent(myGraphicMarker.getContent()); this.map.infoWindow.setTitle(myGraphicMarker.getTitle()); this.map.infoWindow.show(event.screenPoint, this.map.getInfoWindowAnchor(event.screenPoint)); } this.map.graphics.on("mouse-out", lang.hitch(this, function () { this.map.infoWindow.hide(); })); })); }, createcontextmenu: function(){ ctxMenuForGraphics = new Menu({}); ctxMenuForGraphics.addChild(new MenuItem({ label: "info", onClick: lang.hitch(this, function (event) { if (selectedGraphic != null) { some code } }) })); ctxMenuForGraphics.addChild(new MenuItem( { label: "Delete", onClick: function () { some code } })); ctxMenuForGraphics.startup(); on(myGraphicsLayer, 'mouse-over', lang.hitch(this, function (evt) { if (evt.graphic.attributes.name === "my point") { selectedGraphic = evt.graphic; ctxMenuForGraphics.bindDomNode(evt.graphic.getDojoShape().getNode()); }; })); on(myGraphicsLayer, 'mouse-out', lang.hitch(this, function (evt) { if (evt.graphic.attributes.name === "my point") { ctxMenuForGraphics.unBindDomNode(evt.graphic.getDojoShape().getNode()); } })); setinfotemplate: function() { var infotip = new InfoTemplate(); tip = "<font color='#FF0000'>some text</b></font>"; infotip.setContent(tip); infotip.setTitle("Location Info"); myGraphicMarker.setInfoTemplate(infotip); // } },
... View more
11-16-2015
04:59 PM
|
0
|
2
|
3426
|
|
POST
|
I have this script that defines a point, it draws the point at the correct location but it centers the map at the wrong place! Why? Thanks. startup: function() { this.inherited(arguments); pointSymbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 0]), 1), new Color([0, 204, 0]) ); myGraphicPoint = new Point([-121.07462622, 38.90015662]); myGraphicMarker = new Graphic(myGraphicPoint, pointSymbol); myGraphicMarker.setAttributes({"name":"Project Spot"}); myGraphicsLayer = new GraphicsLayer(); myGraphicsLayer.add(myGraphicMarker); this.map.addLayer(myGraphicsLayer); this.map.centerAndZoom(myGraphicPoint.geometry, 8); },
... View more
11-15-2015
04:33 PM
|
0
|
1
|
3648
|
|
POST
|
I am using the launchpad and I wanted have the buffer widget along the attribute table open at the same time. As you change the parameters in the buffer widget, the attribute table would update accordingly. Possible?
... View more
11-12-2015
02:19 PM
|
0
|
0
|
743
|
|
POST
|
A childish mistake. I assumed that the parameter in the this.appConfig.widgetOnScreen.widgets is the widget id and I didn't notice the array. Yes, it works now. However, when the Buffer Selection widget opens it closes the widget that calls it. How can I retain both widgets visible? Thank you.
... View more
11-12-2015
01:47 PM
|
0
|
2
|
2907
|
|
POST
|
Hmm. I am wondering what do I do wrong. config.json: "widgetOnScreen": { "widgets": [ { "uri": "widgets/BufferSelection/Widget", "version": "1.3", "id": "widgets_BufferSelection_53", "name": "BufferSelection", "label": "Buffer Selection", "openAtStart": false }, ............. widget.js of another widget that calls the Buffer Selection ......... var pm = PanelManager.getInstance(); pm.showPanel(this.appConfig.widgetOnScreen.widgets["widgets_BufferSelection_53"]); ........ and I get the error: Cannot read property 'id' of undefined for the second line above
... View more
11-12-2015
01:24 PM
|
0
|
4
|
2907
|
|
POST
|
Robert, for on screen widget that is not visible and not started, I tried this but it does not open the widget var wm =WidgetManager.getInstance(); wm.openWidget("widgets_BufferSelection_53"); The widgets_BufferSelection_53 is the widget id as identified in the config.json Thanks.
... View more
11-12-2015
09:44 AM
|
0
|
8
|
2907
|
|
POST
|
Thank you Robert. I have to work with it. I actually try to compare the values of two select objects to ensure that no identical values are selected. Both select objects carry the same options.
... View more
11-10-2015
02:15 PM
|
0
|
2
|
1346
|
|
POST
|
I know that the dropdownlist in dojo has been depreciated. In flex, once a dropdownlist was clicked on, code could check if certain criteria were met and if not, the value of the list would not change. I am trying to implement similar functionality with dojo/select however, the absence of the "break" to exit a function in dojo, makes this more complex. In dojo, once you click on the select list. it allows the user to change its value. A solution is to store the current value of the select list, and if criteria are not met, then revert the select list to its original value. Any other more simple solutions? Thanks.
... View more
11-10-2015
08:56 AM
|
0
|
6
|
4343
|
|
POST
|
Thank you Robert. Yes, I deleted the posts because I thought it was a simple and naive question and I should try a bit harder to try it out. I keep forgetting to keep the scope of the function with the lang.hitch. Thank you!
... View more
11-09-2015
10:19 AM
|
0
|
0
|
1207
|
|
POST
|
I am not sure how this will work. Since the config_identify.json file has some settings before the layers object, the identity tool need to access these settings to initialize the widget. By modifying the config.json as I posted above, the identify widget will not have access to the settings (since the LocalLayer config file does not have them), and therefore it will fail.
... View more
11-06-2015
01:37 PM
|
0
|
1
|
1207
|
|
POST
|
That's what I thought. When I tried this, the wab wouldn't even render the page. "name": "Identify", "label": "Identify", "version": "1.2.0.2", "IsController": false, "uri": "widgets/Identify/Widget", "config": "configs/LocalLayer/config_Local Layer Widget.json" "index": 4, "id": "widgets_Identify_Widget_54"
... View more
11-06-2015
11:00 AM
|
0
|
3
|
1207
|
|
POST
|
Many thanks to Robert and others for helping our community with their custom widgets. I personally use Robert's Identify, LocalLayer widgets to identify a few. Each of these widgets have their own configuration files. Since most of the times the layers that are utilized in the widgets are the same, I found myself to duplicate most of the configuration in each widget configuration. It would be ideal, if the widgets could share the same config file. So, in the config.json the widgets point to the same config file. Comments? Example in the config.json "widgetPool": { ........................... .................................... "widgets": [ { "name": "Identify", "label": "Identify", "version": "1.2.0.2", "IsController": false, "uri": "widgets/Identify/Widget", "config": "configs/COMMON/config.json", "index": 4, "id": "widgets_Identify_Widget_54" } .................... ........................... "widgetOnScreen": { "widgets": [ { "uri": "widgets/LocalLayer/Widget", "id": "widgets_LocalLayer_Widget_55", "name": "LocalLayer", "label": "Local Layer Widget", "config": "configs/COMMON/config.json", }, ............................... ......................................................
... View more
11-06-2015
10:46 AM
|
0
|
7
|
3268
|
|
POST
|
Thank you Ricky. I looked up at the LocalLayerWidget and it was not straightforward of how to do it. Then, I looked at the Splash Widget, per Robert's suggestion, and voila, it was right at the first block of the css code.
... View more
10-29-2015
01:26 PM
|
1
|
0
|
863
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 10-22-2025 03:33 PM | |
| 1 | 06-27-2025 11:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|