|
POST
|
I did wonder about passing the innerHTML instead of the grid, but the sample came from one of web developers which is not familiar with dojo datagrids. I'm sure he stuck with what he is familiar with. I'm a little confused about the ... you put in the dojo.forEach. Are you thinking something more is needed there? I can't think what, but it is Monday morning!
... View more
01-07-2013
04:37 AM
|
0
|
0
|
2118
|
|
POST
|
What is the easiest way to print the contents of a datagrid? I have a grid that is populated with the results of a query or find. My frame is defined as <div id="bottomPane" data-dojo-type="dijit.layout.ContentPane" region="bottom" style="width:auto, position:absolute; top:auto"> <div dojoType="dojox.layout.Dock" id="dock" widgetid="dock"></div> <h3 id="gridTitle">Providers in this area: </h3> Click Provider Map to see these locations. <button id="btnPrint" dojotype="dijit.form.Button" onClick="printIt(document.getElementById('resultsGrid').innerHTML); return false;" title="Print List" value="Print List">Print List</button> <table data-dojo-type="dojox.grid.DataGrid" id="resultsGrid" selectionmode="none" > <thead> <tr> <th field="PIN" formatter="makeZoomButton" width="35px" title="First, open map,click on ID to see location."> </th> <th field="FACILITY" width="400px">Provider</th> <th field="ADDRESS" width="320px">Address</th> <th field="CITY" width="190px">City</th> <th field="PHONE" width="150px">Phone</th> </tr> </thead> </table> </div> My print button calls a function that creates a simple HTML for printing: function printIt(printThis) { var win = window.open(); self.focus(); win.document.open(); win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>'); win.document.write('body, td { font-family: Verdana; font-size: 12pt;}'); win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>'); win.document.write(printThis); win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>'); win.document.close(); win.print(); win.close(); } This does create something printable, but the rows are at the very top of the page and the headers are sandwiched between the 1st and 2nd row. I'm thinking it might be as simple as adding some additional styling to this print function? Also there are two small square at the bottom that are maybe tiny cells? They look like checkboxes. I thought maybe it was the zoom icon I have in the first column that will add an infoWindow, but I took that out and it didn't make a difference. [ATTACH=CONFIG]20464[/ATTACH] I did find that the enhanced grid maybe had some printing capabilities, but I don't want to pull apart my entire code, which is done except for this printing.
... View more
01-04-2013
12:43 PM
|
0
|
7
|
4858
|
|
POST
|
I started out as a FLEX developer and I still miss a lot of things about it. Better options for developing the look and feel of the interface probably most of all. I haven't heard anything lately about Silverlight, but it sounds like it's not got a long life to it either. If I was starting from scratch, I would probably pick Javascript just because it's the most likely to be around for the long run. I wouldn't completely discount Flash, though, if you were needing to develop a mobile app, as opposed to a mobile friendly web site. These are written in Adobe Air, which doesn't run in the Flash player.
... View more
01-03-2013
05:46 AM
|
0
|
0
|
2878
|
|
POST
|
12.0. I tracked down an old thread that described a similar situtation, but for tabs in a tabcontainer rather than a floating pane. It did mention my default size of 400 x 400 as being an issue with map content for a container that's not yet initialized. So I either need to initialize it differently than I have or just figure out a way to define the height and width before it opens the floating pane. This started originally with a map in the center of the layout and a list in the left pane. I didn't really change it up too much which I switched it to this version. Mostly I wrapped the mapDiv in a floating pane when it had been in a regular contentPane. Mostly this has worked, but I think this problem is a side effect of not having my initializations in the right order now.
... View more
01-02-2013
10:37 AM
|
0
|
0
|
784
|
|
POST
|
I knew I needed a different pair of eyes! I was sure that would fix it, but it didn't!. I'm noticing setting a breakpoint when the map is created, it's height and width are defined as 400x400 px. In the documentation, it says the size is determined by the div it's in. but since my div is within a floating pane that isn't yet opened, maybe it's getting confused? I have set explicit dimensions (comparable to the dimensions of the floating panel), to 100% to auto and to inherit (which all sound the same to me, but I'm sure have subtle differences!). Nothing is making my map budge from it's 400 x 400 size. In Firebug, I can set the dimensions of the mapDiv and mapDiv_root, which seems to be the container within it once it's renderer, but adding dimensions for the styles of those doesn't make any difference. The map is still not resizing when I resize the pane. I have the resizeHandle.css referenced, which seems to be a common error people make. My 'workaround' is to have the dimension of the floating pane to also be a square, so it's not so obvious I have a problem. But that's no kind of solution! I did finally dig around enough in the style of the dock to get my button to look better!
... View more
01-02-2013
08:18 AM
|
0
|
0
|
784
|
|
POST
|
I have a map that starts with a search of facilities. The user can decide once they see the list if they also want to see a map of the features. By default, no map is shown. I created a floating pane for the map and set a dock to act as a button for the user to click on to open the map. First of all, I'm having a little problem styling the dock 'button'. I've been working to have an image on it as well as a piece of text, but at the moment it still looks like a button separate from the image and not a single seamless looking object. Secondly, when you click the button that opens the floating pane, in Firefox, the map only takes up the left 1/2 of the pane. It seems to look OK in IE (very surprising!). I have my map height and width set to 100%, but somewhere I'm missing another setting to fill the pane properly. [HTML]http://wwwgis.dhss.mo.gov/Website/VCFprovider/provider.html[/HTML] Third, when I resize my floating pane, my map isn't resizing. I thought I was accounting for that, but maybe it makes a difference that the pane is dynamically resizable as opposed to a map that might be resized because of a browser resize? Last, in IE, my grid, which I think I have hidden or invisible at start up until the user makes a selection, shows an outline of the grid column headings in IE, but not Firefox.
... View more
01-02-2013
06:12 AM
|
0
|
4
|
2914
|
|
POST
|
I agree, there are only a few things that you have to watch out for. Our default browser is IE 8 and we still have users at IE 7. I was able to use the dojox mobile components and make it work on both mobile and browsers. Of course it's styled for mobile, but technically it does work on multiple devices.
... View more
12-21-2012
10:46 AM
|
0
|
0
|
1951
|
|
POST
|
Did you get this figured out yet? I got stuck in the same place, trying to sort out points vs. geometry etc. Not only did I want to enter an address, I still wanted my identifytask to work too. I created a couple of variables var geometryPt;
var idFromClick = true; Your identify parameters are not anything different. For me I added an onClick event on the map. This gave me a place to call an identifyTask function that would work both from a click and from the results function of the locate. dojo.connect(map, "onClick", function () {idFromClick = true;});
dojo.connect(map, "onClick", executeIdentifyTask); This is my executeIdentifyTask function. My identify was likely to return from multiple layers, so you'll need the same deferred technique if you do too. You need to pay attention to what sort of geometry you are using in your identifyparameters. When I call it from a click event, I needed to convert it to a mapPoint because it's only coordinates/geometry. When you get the results of a locator, it's already a point, so you need to keep track of whether a click or a geocode is the input. function executeIdentifyTask(evt) {
identifyParams.mapExtent = map.extent.expand(0.1);
identifyParams.geometry = evt;
var inputPt = evt;
if (idFromClick) { // input from map click
identifyParams.geometry = evt.mapPoint;
inputPt = evt.mapPoint;
}
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function(response) {
// response is an array of identify result objects
// Let's return an array of features.
return dojo.map(response, function(result) {
var feature = result.feature;
feature.setInfoTemplate(myTemplate);
return feature;
});
});
// InfoWindow expects an array of features from each deferred object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback like the one above to post-process the response and return an
// array of features.
map.infoWindow.setFeatures([ deferred ]);
map.infoWindow.resize(175,100);
map.infoWindow.show(inputPt); //point type is the same coming from either method
//map.infoWindow.show(evt.mapPoint);
} Then make a few modifications to the standard locate and showResults functions. You can edit out the lines I have for "containsCounty". I'm mapping a whole state and I needed to handle somehow a user entering "Jackson County, MO" or some other county name instead of a city. function locate() { You can see at the very end I'm using the geocoded point as the input to the identify.
idFromClick = false; //executeIdentifyTask handles the type of point being passed.
map.infoWindow.hide();
map.graphics.clear();
geometryPt = "";
var address = {"SingleLine":dojo.byId("txtAddress").value};
locator.outSpatialReference= map.spatialReference;
var options = {
address:address,
outFields:["Loc_name"]
};
locator.addressToLocations(options);
}
function showResults(candidates) {
var candidate;
var symbol = new esri.symbol.SimpleMarkerSymbol();
var addressTemplate = new esri.InfoTemplate("Location", "Address: ${address}<br />");
symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE);
symbol.setColor(new dojo.Color([255,0,0,0.75]));
dojo.every(candidates,function(candidate){
console.log(candidate.score);
if (candidate.score > 80) {
console.log(candidate.location);
var attributes = { address: candidate.address, score:candidate.score, pt:candidate.location };
geometryPt = candidate.location;
var graphic = new esri.Graphic(geometryPt, symbol, attributes, addressTemplate);
//add a graphic to the map at the geocoded location
map.graphics.add(graphic);
//add a text symbol to the map listing the location of the matched address.
var displayText = candidate.address;
map.infoWindow.show(geometryPt);
map.infoWindow.setTitle("Address");
return false; //break out of loop after one candidate with score greater than 80 is found.
}
});
if(geometryPt !== undefined){
var containsCountyPosition = (dojo.byId("txtAddress").value.toLowerCase().indexOf(" county"));
if (containsCountyPosition > 0) {
map.centerAndZoom(geometryPt,10);
} else {
map.centerAndZoom(geometryPt,12);
}
executeIdentifyTask(geometryPt);
}
... View more
12-21-2012
10:42 AM
|
0
|
0
|
474
|
|
POST
|
I thought nobody. But when I sent out my link, asking them to check and let me know what device they were using, 2 out of the 9 people who responded had one.
... View more
12-20-2012
11:36 AM
|
0
|
0
|
954
|
|
POST
|
Now that I have this in production, it doesn't look like Windows phone is accounted for in the list. I'm having a hard time figuring out for sure what that is. Is it iemobile or something else?
... View more
12-20-2012
10:06 AM
|
0
|
0
|
954
|
|
POST
|
I have an IdentifyTask which was likely to return multiple points because the features are colocated. Through some examples, I saw that I needed to build an array to set the features for map.infowindow.setFeatures.
function executeIdentifyTask(evt) {
identifyParams.mapExtent = map.extent;
identifyParams.geometry = evt; //input from address, evt is already a map point
var inputPt = evt;
identifyParams.geometry = evt.mapPoint;
inputPt = evt.mapPoint;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function(response) {
// response is an array of identify result objects
// Let's return an array of features.
return dojo.map(response, function(result) {
var feature = result.feature;
feature.attributes.layerName = result.layerName;
feature.setInfoTemplate(infoTemplate);
return feature;
});
});
// InfoWindow expects an array of features from each deferred object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback like the one above to post-process the response and return an
// array of features.
map.infoWindow.setFeatures([ deferred ]);
map.infoWindow.show(inputPt); //point type is the same coming from either method
// map.infoWindow.show(evt.mapPoint);
}
I have the definitions set for Popup (a popup variable defined as well as including that in my map definition).
var popup = new esri.dijit.Popup({
fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NULL,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]), 3), new dojo.Color([255,255,0,0.35]))
}, dojo.create("div"));
var spatialReference = new esri.SpatialReference({wkid: 102100 });
startExtent = new esri.geometry.Extent(-10723197,4186914,-9829190,4992866, spatialReference);
map = new esri.Map("map",{extent:startExtent, infoWindow:popup} );
With this definition, when I do an Identify, no only do I get the left/right arrows to step through any multiple records that are identified, but I also get the "zoom to" at the bottom of the infoWindow. Within this same code, I have a datagrid with a list of features. I have added the zoom button based on the example DataGrid with zoom button. I'm not sure I really want to zoom, instead I really wanted to have this also trigger the infoWindow. Not all my attributes are in my datagrid, only an ID number and a status. The infoWindow would show all the attributes.
function zoomRow(id){
// alertLayer.clearSelection();
var query = new esri.tasks.Query();
// query.text = id;
query.where = "Server_ServerName = '" + id + "'";
query.outFields = ['*'];
query.returnGeometry = true;
var zoomQueryTask = new esri.tasks.QueryTask("https://ogi.oa.mo.gov/arcgis/rest/services/ITSD/serverLocation/MapServer/0");
zoomQueryTask.execute(query,showAlertResults);
}
function showAlertResults(results) {
var feature = results.features[0];
feature.setInfoTemplate(infoTemplate);
var content = esri.substitute(feature.attributes,infoTemplateContent);
map.infoWindow.setContent(content);
map.infoWindow.setTitle(feature.attributes.FlagStatusReason);
// map.infoWindow.setContent(content);
map.infoWindow.show(feature.geometry);
}
Even though I'm still calling map.infoWindow.show, these infoWindows don't have the zoom to in them. Am I going to have to go through the same steps for the queryTask that the Identify has (setting a callback on deferred etc etc) in order to get the 'zoom to' to be in my InfoWindow? I don't really understand exactly what was triggering this in the first place.
... View more
12-20-2012
06:53 AM
|
0
|
0
|
3479
|
|
POST
|
We're about to roll out our first mobile Javascript application based on the Find Nearby location example, which uses dojox mobile. It worked better on mobile devices that it did in the older browsers we have installed (IE7, IE8). I felt like I needed it to work in our browsers too, not just on mobile. The first thing people will do when you send out a notice of a new map is to try it out (no matter what device they happen to be using at the time!). I spent a fair amount of time debugging for IE and I ended up having to use a slightly older version of the Javascript library, which ended up working better for IE (used version 2.8). Even though the example is written calling the iPhone CSS, it has been tested successfully on an Android, Windows Phone and Blackberry too. I don't know about Sencha touch.
... View more
12-19-2012
11:06 AM
|
0
|
0
|
995
|
|
POST
|
It seems to be working better now in terms of references to the JS API, but I see the Code Gallery is still empty of content. Since there hasn't been any official acknowledgement there is an issue, I'm not sure if it's on the way to getting fixed or not.
... View more
12-19-2012
10:44 AM
|
0
|
0
|
1653
|
|
POST
|
I got a phone call on the incident I placed. I found out they have been doing some edits on the javascript API files. Supposedly they shouldn't have caused any of us a problem. The comment was made that maybe it was on my end, which I highly doubt given the responses to this thread already. It is being looked into.
... View more
12-19-2012
09:04 AM
|
0
|
0
|
1653
|
|
POST
|
All my code is running very slow today. Both the references to the ESRI base maps as well as the references that being made to serverapi.arcgisonline.com are taking forever (like a minute instead of seconds) Is anyone else experiencing this? I had placed a call with ESRI. I would have expected to see a notice at status.arcgis.com, but so far nothing.
... View more
12-19-2012
07:04 AM
|
0
|
6
|
2137
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|