|
POST
|
The description does say "infoWindow", but it's in the generic sense and not an esri infoWindow. The esri InfoWindow is ineffective as a tooltip. There is already a infoTemplate for the graphics. If the user clicks on a graphic to open infoWindow with the infoTemplate, then moves the mouse over another graphic the infoWindow is going to close and reopen as the tooltip. Doesn't seem very user friendly to me. Also I doubt that a tooltip is more coding that dealing with the infoWindow.
... View more
07-19-2013
01:15 PM
|
0
|
0
|
1928
|
|
POST
|
The sample that btfou posted uses an InfoWindow.] Incorrect. This sample uses a dijit/TooltipDialog with mouse-over and mouse-out events. Nothing to do with infoWindow. Based on the links in the original post this is the functionality needed. Ray - ran this in the console of your map: var dialog = new dijit.TooltipDialog({
style: 'position:absolute; width:100px;'
});
dojo.style(dialog.connectorNode, 'display', 'none');
dialog.startup();
map.getLayer('points_glayer').enableMouseEvents();
map.getLayer('points_glayer').on('mouse-over', function (evt) {
//set the content to your local well no field
//dialog.setContent(evt.graphic.attributes.WELL_NO);
dialog.setContent('Hi! I'm a tooltip');
dijit.popup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
});
map.getLayer('points_glayer').on('mouse-out', function (evt) {
dijit.popup.close(dialog);
}); I noticed your points_glayer doesn't have attributes. When you create the graphics form your data source take the well number and add it as an attribute of the graphic like this graphic.setAttributes({ WELL_NO: the_well_no }); then you can use it to display as shown in commented part of the code above.
... View more
07-19-2013
12:19 PM
|
0
|
0
|
1928
|
|
POST
|
Here's a function from my base that takes the attributes of a feature and the feature layer itself as arguments, and returns a simple table. Also shows how to test a value against a URL regular expression. featureAttributeTable: function(atts, feature) { var table = '<table cellspacing="0" cellpadding="2" style="width:100%;">'; for (var i in atts) { var alias; dojo.forEach(feature.fields, function (field) { if (field.name === i) { alias = field.alias; } }); var value = atts; var exp = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/); if (exp.test(value)) { value = '<a href="' + atts + '" title="' + atts + '" target="_blank">Hyperlink</a>' } table += '<tr><td><b>' + alias + '</b></td><td>' + value + '</td></tr>'; } table += '</table>'; return table }
... View more
07-19-2013
09:26 AM
|
0
|
0
|
1037
|
|
POST
|
Here's sample https://developers.arcgis.com/en/javascript/jssamples/fl_hover.html that is a good starting point for showing a tooltip for graphics.
... View more
07-19-2013
09:04 AM
|
0
|
0
|
1928
|
|
POST
|
The field infos, including alias can be found in the FEATURE_LAYER.fields object.
... View more
07-19-2013
08:50 AM
|
0
|
0
|
1037
|
|
POST
|
Your map object is not formed correctly. Map options follow the map div in curly brackets as pairs. See https://developers.arcgis.com/en/javascript/jsapi/map.html for more on map options. Like this: map = new esri.Map("map", { extent: initExtent } ); P.S. please wrap code and html in tags. Select text in editor and click the appropriate button. See attached.[ATTACH=CONFIG]25729[/ATTACH]
... View more
07-04-2013
11:49 AM
|
0
|
0
|
636
|
|
POST
|
I don't think esri classes support multiple event listeners with a single on style event. They register but don't fire. It's not a big deal. I was trying to reduce code by using one listener for two events that do the same thing.
... View more
07-02-2013
08:08 AM
|
0
|
0
|
830
|
|
POST
|
dojo/on supports multiple event listeners like: dijit.byId('test').on('click, contextmenu', function() {
alert('hi')
}); however multiple events don't work on a map: //this doesn't work
app.map.on('mouse-move, mouse-drag', function(evt) {
//do something or other
});
//neither does this
app.map.on('click, contextmenu', function(evt) {
//do something or other
}); Why is this and will it be possible in a future version?
... View more
06-29-2013
03:42 PM
|
0
|
2
|
3323
|
|
POST
|
Try resizing your grid after setting the store grid.resize(); Also check out the api reference http://dojotoolkit.org/api/ for dojox/grid/DataGrid and look at the sizing/display properties like autoHeight and autoWidth. Grids are inexplicably temperamental. Depending on the type of container it's in or how it's created (programmatic or declarative) make a difference in rendering. Also, try wrapping the grid in a plain dijit/layout/ContentPane with no padding. I'm not sure if jquery is causing problems, but this should help if it is.
... View more
06-27-2013
11:27 AM
|
0
|
0
|
763
|
|
POST
|
Yes. Create a html file and call it form.html or whatever with just the code within the content pane. Load the html in the content pane on load by setting href property: [HTML] <div id="myContentPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'My Form', preload:true, preventCache: true, href:'form.html'"> </div>[/HTML] Update the content by the method you are currently using. The reset function would look like this: function reset() {
cp = dijit.byId('myContentPane')
cp.set('href', 'form.html');
cp.refresh(); //may or may not need to refresh
} I don't think you can use the refresh() method once you have set the content to something else programmatically, however you may need to call refresh() after setting the href. Notice I set preventCache to true, or else you will have to clear browser cache if you make changes to the html file. This is a good idea when in development. Once you deploy it can be removed.
... View more
06-26-2013
10:07 AM
|
0
|
0
|
2615
|
|
POST
|
The refresh() method reloads the "href" property of the content pane. In your example you do not have the "href" property set so it loads the base url of the application. To reset the content you need to use dijit.byId('myContnetPane').set('content', 'THE ORGINAL MARKUP') like you did on your gp result.
... View more
06-26-2013
08:24 AM
|
0
|
0
|
2615
|
|
POST
|
I did some testing and the following works. The map had to be the first pane to load properly. html, body { width:100%; height:100%; margin:0; padding:0; }
#stack { z-index:1; width:100%; height:100%; padding:0; background-color:#EFEFEF; }
#map { z-index:1; width:100%; height:100%; padding:0; background-color:#EFEFEF; }
#info { z-index:1; width:100%; height:100%; pading:1em; background-color:#EFEFEF; }
#geo { z-index:1; width:100%; height:100%; pading:1em; background-color:#EFEFEF; } [HTML]<div id="stack" data-dojo-type="dijit/layout/StackContainer" data-dojo-props=""> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props=""> </div> <div id="info" data-dojo-type="dijit/layout/ContentPane" data-dojo-props=""> </div> <div id="geo" data-dojo-type="dijit/layout/ContentPane" data-dojo-props=""> </div> </div>[/HTML] If you want the map to not be the first pane, e.g. a welcome pane first, you would need to load the map the first time the map pane was selected.
function load() {
var conn = new dojo.connect(dijit.byId('map'), 'onShow', function() {
dojo.disconnect(conn);
//load map
});
}
dojo.ready(load);
... View more
06-21-2013
08:36 AM
|
0
|
0
|
1385
|
|
POST
|
I don't know how you could do something onPrintStart because you don't have the image url back from the server yet. Wait a second...I just noticed you are using the print widget. There isn't a way to alter the returned url before the widget turns the button into a link without hacking the widget on a local install. I use esri.tasks.PrintTask, which returns the output url, which I'm able to add the timestamp to before creating a link or button.
... View more
06-20-2013
01:29 PM
|
0
|
0
|
2178
|
|
POST
|
Adding the querystring "?time=SOME_TIME" to the end of the url prevents cache. In your code: dojo.connect(printer, 'onPrintComplete', function(value){
var time = new Date();
var url = value.url + '?time=' + time;
console.log('The url to the print image is : ' + url);
});
... View more
06-20-2013
12:57 PM
|
0
|
0
|
2178
|
|
POST
|
var time = new Date();
dojo.place('<div style="padding-bottom:2px;border-bottom:1px solid #B5BCC7;margin-bottom:4px;"><a href="' + result.url + '?time=' + time.getTime() + '" target="_blank">' + title + '</a><br /><span style="font-size:10px;color:#444;">' + time.toLocaleString() + '</span></div>', 'tasks-print-result', 'last'); Add a timestamp to the url. Tracy - You should throw a party once you get all the kinks out of printing. I did. 🙂
... View more
06-20-2013
12:33 PM
|
0
|
0
|
2178
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2013 06:56 AM | |
| 1 | 06-30-2015 09:17 AM | |
| 1 | 10-12-2013 07:14 AM | |
| 1 | 02-05-2014 11:05 AM | |
| 1 | 05-28-2015 11:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|