|
POST
|
There were multiple people participating in this thread. The sample code I posted has been working for me. Since I wasn't the person who originally asked the question, I can't mark any particular response as the correct answer.
... View more
04-02-2014
01:07 PM
|
0
|
0
|
1893
|
|
POST
|
Apparently it did not like the resizeMap getting called in the map onload event since it's not part of the initial view. I commented out the call to it and it works now. function mapLoadHandler(evt) { // resizeMap(); registry.byId('mapView').on('AfterTransitionIn', resizeMap); }
... View more
03-28-2014
05:47 AM
|
0
|
0
|
1139
|
|
POST
|
I've tried it both ways, autoResize:true and autoResize:false. Neither yields a map that draws correctly. The 2nd time I toggled the view, from About to Map, using autoResize:true, the map didn't display anything at all. I'm hoping someone on your end can eventually address this issue in the API itself, so we don't all have to do these workarounds. At first I thought the issue was the fact that I chose to use dojo rather than something like jQuery. But the threads in these forums related to this issue mention several different JS libraries. As I read them, it doesn't seem to matter which of those you choose, the problem is in the ESRI JS library we're all trying to use. Very frustrating.
... View more
03-28-2014
05:23 AM
|
0
|
0
|
1139
|
|
POST
|
I guess I don't know what "you have to handle the resize yourself" really means. In one thread I saw that adding the autoResize:false parameters to the map definition was suggested. So I did. But in this example there seems to be code to handle the resize, without having to do anything more. Isn't what these functions are for?
function mapLoadHandler(evt) {
resizeMap();
registry.byId('mapView').on('AfterTransitionIn', resizeMap);
}
function resizeMap() {
mobile.hideAddressBar();
adjustMapHeight();
map.resize();
map.reposition();
}
What else is there to it? This looks to me that it should fire the resizeMap function every time it transitions to the mapView, which contains map.resize and map.reposition. But it doesn't display right. Plus it often generates errors on some of the tiles in the streets base map, which I also think is weird.
... View more
03-27-2014
01:55 PM
|
0
|
0
|
1139
|
|
POST
|
I think this is a very common scenario and I've read several threads about this. Instead of opening with a map, you want to show something else instead first, maybe a query, and then show the results on a map next and/or optionally. There seems to be all sorts of issues dealing with a map 'after the fact', Once your map isn't part of your initial display, there's all sorts of extra steps you have to take to deal with this. For example: In the mobile_dev.html tutorial, there are two views, one Map and one for About. It initializes with a map first. But what if I want to have the About on top? All I did was switch the positions, and change the about to have the 'selected:true' defined. I'm not sure I even needed to physically change the order in the code: <body> <div id="aboutView" data-dojo-type="dojox.mobile.View" data-dojo-props="selected: true"> <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props="back:'Map', moveTo:'mapView'">About</h1> <p style="padding: 5px;">This area can contain additional information about your application.</p> <p>Ex quorum ab quorum non senserit magna se litteris firmissimum. Pariatur fore elit do dolor, eram vidisse id proident, nam anim ea multos, ab multos offendit. Labore coniunctione senserit legam commodo. Aut in voluptatibus, ab singulis consectetur iis e culpa enim ad quamquam ubi ita amet quibusdam. Quis iudicem e nostrud, in veniam varias nisi admodum, eiusmod esse quamquam arbitror sed dolor eruditionem commodo eram consequat. Esse cupidatat te culpa nisi. Vidisse lorem minim ab nulla. </p> </div> <div id="mapView" data-dojo-type="dojox.mobile.View" > <div id="header" data-dojo-type="dojox.mobile.Heading"> <div id="aboutButton" data-dojo-type="dojox.mobile.ToolBarButton" style="float: right;" moveTo="aboutView">About</div> </div> <div id="mapContainer" data-dojo-type="dojox.mobile.ContentPane"> <div id="map"></div> </div> </div> </body> When you do this, when you switch to the map, first it is cropped to a narrow column and then it disappears completely. I don't understand why. In this particular example there seems to be all sorts of extra functions for map resizing etc and you'd think somewhere in there the map would be properly displayed. I see this same behavior in both Firefox and Chrome.
... View more
03-27-2014
01:02 PM
|
0
|
5
|
1483
|
|
POST
|
My opening view on my site starts with the ability to run a query. Once the query executes, then the user has the option to query another county or view a map of the results. This works fine in Firefox, IE and Chrome. Where it fails is on a iPad. When you switch to the map, first it flashes, then it shows briefly my county boundary layer, chopped on the E and W, but otherwise the whole state and not the right extent, and then disappears entirely. I wonder if it is because the initial view doesn't contain my map. Instead the map extent is set and the view transitions from my main view to my map view. This doesn't seem like it should be a deal breaker on an iPad, especially since I'm using all the components I think I'm supposed to be 'mobile friendly'. Here's my link: http://jsfiddle.net/schlot/9zv22/1/ I would also like to have a dropdown arrow and a prompt in my county selection box, but that's a detail.
... View more
03-27-2014
07:26 AM
|
0
|
0
|
602
|
|
POST
|
I don't know if you can make use of how I did mine, but I needed to do something similar. I had a township layer and I needed to generate a drop down list with all the choices, using a filteringselect. I think you are better off first creating an array to hold all your selections and then using that to populate a Memory and then define that as the store to your filteringSelect. First I keep all my tool in a right hand pane inside titlePane's so the location of the filteringSelect looks like this:
<div id="tp_twpSearch" data-dojo-type="dijit/TitlePane"
data-dojo-props="title:'Find Township / Range', closable:false, open:false">
<div id="searchDiv">
<select id="pickSelect" data-dojo-type="dijit/form/FilteringSelect" placeHolder="Select a township"
data-dojo-props="title:'Find points in selected township/range',maxHeight:200, size: 30, queryExpr:'${0}*', ignoreCase:true">
</select>
</div>
</div>
Since I figured I might want to use this functionality later, I made a function that would accept a layer name and the field it needed to use. This is executed on map load.
populateDropDownList(twpRngLayer, "LABEL_1");
These are the functions that run the query and populate the dropdown. You'll need to make sure to have all the appropriate requires defined.
//Populates pick list
function populateDropDownList(dropdownLayer, pickField){
pickAttr = pickField;
pickLayer = dropdownLayer;
var queryTask = new QueryTask(pickLayer.url + "/0");
var query = new Query();
query.outFields = [pickField];
query.where = "1=1";
query.returnGeometry = false;
query.outSpatialReference = spatialReference;
queryTask.on('complete', populateResultsHandler);
queryTask.on('error', errorHandler);
queryTask.execute(query);
}
function errorHandler(err){
console.log("Error executing queryTask: " + err.details);
}
function populateResultsHandler(results){
var select = registry.byId("pickSelect");//my filteringSelect dijit
pickList.length = 0;
var numResults = results.featureSet.features.length;
for (var j = 0; j < numResults; j++) {
var pickCode = results.featureSet.features .attributes[pickAttr];
pickList.push({id: pickCode, label: pickCode});
}
pickList.sort(function(item1, item2) {
var label1 = item1.label.toLowerCase(),
label2 = item2.label.toLowerCase();
return (label1 > label2) ? 1 : (label1 < label2) ? -1 : 0;
});
var dataStore = new Memory({data:pickList, idProperty:"id"});
select.set ("searchAttr", "id");
select.set("labelAttr", "id");
select.set("store", dataStore);
}
... View more
03-21-2014
01:42 PM
|
0
|
0
|
1364
|
|
POST
|
Yes, I am selecting points, but I have an if statement that sets the map to center and zoom if there is only one feature returned. I thought maybe my queryTask wasn't done executing, so I changed it to have a queryTask.on('complete') trying to make sure the executing is done before it finishes. The queryTask is also populating a dGrid, which looks just fine, so I know the queryTask is executing and returning what I would expect. The problem looks to be limited to extent of the results. The idea of a union isn't going to work with points. I wonder if my problem is that the map is in a floating pane, and that there is some sort of delay. Even after that pane is open, it still doesn't set the extent correctly. From what I can see, it is almost always centered on the first point returned from the query. I've seen a few other threads with people having the same problem, I have to wonder if there is an issue with graphicsExtent itself. http://jsfiddle.net/schlot/9zv22/1/
... View more
03-17-2014
06:43 AM
|
0
|
0
|
3367
|
|
POST
|
I'm mistaken, it doesn't work properly in Firefox either. It seems to be moving to the general vicinity of my featureSet, but it isn't set to the extent. Instead, if I zoom out several times manually, I can see the points. I'm wondering of the features returned as the results of a queryTask are the same as the results of a selectFeatures on a featureLayer. Both say they are a featureSet.
... View more
03-17-2014
05:32 AM
|
0
|
0
|
3367
|
|
POST
|
I'm having problems with this too, especially in IE 8, which is still our version for IE. In the code
var selExtent = graphicsUtils.graphicsExtent(featureSet.features);
the variable selExtent is not found, it returns null. There are features in my featureSet, which is a result of a queryTask. This works just fine in Firefox, but not in either Chrome or IE.
... View more
03-14-2014
12:48 PM
|
0
|
0
|
3367
|
|
POST
|
The user says it was working yesterday, which makes me think it is internal to us. But my other JS sites are all working. Of course this is just about the oldest one, so there could still be an issue with the JS library.
... View more
03-14-2014
07:37 AM
|
0
|
0
|
1459
|
|
POST
|
I can believe that, they are constantly pushing patches and updates with no notice. That isn't going to be satisfactory answer for the user, though. It just so happens that I've been working on updating it, since it's not styled to be mobile-friendly, but I'm not ready to push it out today!
... View more
03-14-2014
07:21 AM
|
0
|
0
|
1459
|
|
POST
|
I have an older site that was based on the 3.2 version of the API library. It's been working fine for the past year or so. Today I got an email that the site is not working. I've made no changes on this end. I am getting errors that one of the buttons that's within a border container doesn't have a region set. When I commented that out, just to see what would happen, the next component generated the same type of error. Are the older locations still available and is it not OK to assume these will still be in place for longer than a year? This site isn't that old. This is an example of the path I had in my code. It was valid at the time I wrote it. http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" The URL to the site is http://http://gis.dhss.mo.gov/Website/VFC/provider.html
... View more
03-14-2014
07:15 AM
|
0
|
6
|
1668
|
|
POST
|
I finally started over with a project that was working that had mostly all mobile objects. It's working the way I envisioned now. I'm just down to styling it.
... View more
03-13-2014
11:55 AM
|
0
|
0
|
657
|
|
POST
|
The user wants to be be to enter either an address or pick a county from a list and search for providers based on that location. They don't want to start with a map, they want to give that as an option only after the list is displayed. I had it working OK originally using a floating pane, but I also need to make it work on a mobile device. I decided it wouldn't be too bad to have the results of the query come up in another dojox/mobile/View, with the option to either show a map, return to the original page or print. I know I must not have my required features in the right order, or something wrong with the parsing, but I can't figure out where I'm going wrong. The results don't come up in a different view, they get tagged down below the search section like it's all one big View, rather than transitioning to another one. Can anyone spot where I'm going wrong? http://jsfiddle.net/schlot/9zv22/
... View more
03-12-2014
01:06 PM
|
0
|
1
|
1061
|
| 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
|