|
POST
|
Ben, remove the #map_infowindow part from that CSS snippit. It should just be this: .simpleInfoWindow {
border: 2px solid #455268;
background-color: #dfe5d7;
background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fcfff4), color-stop(40%,#dfe5d7), color-stop(100%,#b3bead));
}
... View more
08-26-2015
04:04 PM
|
0
|
1
|
1478
|
|
POST
|
Consider the lone source but this discussion has a comment saying distinct isn't supported in FileGeoDbs. Maybe it needs to be in an SDE database?...
... View more
08-26-2015
11:19 AM
|
0
|
3
|
2560
|
|
POST
|
What permutations of your where clause have you tried? Shouldn't it be more like this: query.where = "AgencyAcronym <> null";
... View more
08-26-2015
10:57 AM
|
0
|
5
|
2560
|
|
POST
|
I haven't worked with LODs myself but they're essentially a pure JS multi-dimensional array so you could just place that into a standalone JS file and load it into your project like any other JS traditional JS file. Your lods.js file would be: var lods = [
{"level" : 0, "resolution" : 0.010986328125, "scale" : 4617149.97766929},
{"level" : 1, "resolution" : 0.0054931640625, "scale" : 2308574.98883465},
{"level" : 2, "resolution" : 0.00274658203125, "scale" : 1154287.49441732},
{"level" : 3, "resolution" : 0.001373291015625, "scale" : 577143.747208662},
{"level" : 4, "resolution" : 0.0006866455078125, "scale" : 288571.873604331}
]; Now load it anytime before your JS file which constructs the map: <script type="text/javascript" src="js/lods.js"></script>
<script src="http://js.arcgis.com/3.14/"></script> So long as the variable has a global scope, you could then refer to it during your map construction: var map = new Map("map", {
lods: lods
}); EDIT: Ken beat me to the punch. His idea is probably better.
... View more
08-21-2015
09:05 AM
|
1
|
0
|
1334
|
|
POST
|
Having just added the Search widget into my project, I discovered some unexpected behavior. My app is patterned after this sample. To start, I add a new feature by clicking on one of the predefined options found in the editor widget: Next, I go over to my Search Widget and look for an address (using a locally hosted Geocoder service): I close the geocoded popup and clear the contents of the widget by clicking the X in the input field. Now, if I go back to the point I previously created (or any other feature for that matter), the infoWindow that comes up is a copy of the geocoded result infoWindow: That's pretty weird. The only way to "reset" things is to reload the page. It's bad enough I can't use custom infoWindows when I using the Editor widget but this makes things even worse.
... View more
08-17-2015
02:56 PM
|
0
|
8
|
4516
|
|
POST
|
Thanks, Chris. Your response led me in the right direction. I was fixated on the front part of the URL and didn't notice that the actual operation it was requesting ("suggest") did not exist. When I switched the "enableSuggestions" option to false in the constructor, the widget worked as it should. I need to re-create the geocoder in 10.3 to get it to work with suggestions. Thanks, though! Steve
... View more
08-17-2015
11:39 AM
|
2
|
0
|
1650
|
|
POST
|
Trying to use the Search widget for the first time and I'm getting an "Invalid URL" as I start to type in the widget. The service itself works since I can use it via the REST directory: I'm modeling my code partly after what's in this thread (April 22nd by John Ritsko). Anyways here's my code: var s = new Search({
map: app.map,
sources: [{
locator: new Locator(SERVERPATH + "/transportation/StreetsGeocder/GeocodeServer"),
singleLineFieldName: "Single Line Input",
name: "County Geocoding Service",
localSearchOptions: {
minScale: 300000,
distance: 50000},
placeholder: "Search for Street / Address",
maxResults: 3,
maxSuggestions: 6,
enableSuggestions: true,
minCharacters: 0
}]
},"search");
s.startup(); Here's the error in the console: I've tried both an absolute URL to the Geocoder service as well as the relative pathing as shown above. So what gives? Thanks! Steve
... View more
08-17-2015
11:11 AM
|
0
|
2
|
4945
|
|
POST
|
Since I'm experiencing the same thing, I take it this issue from 2012 was never addressed? Sigh.
... View more
08-14-2015
03:36 PM
|
0
|
0
|
685
|
|
POST
|
FWIW, this link is what I originally found when researching global variables and Javascript. It turns out the curly braces are the proper way; I don't know how I mangled it to be brackets! Oddly enough, brackets still work in my applications. Oh well. Glad you got it all sorted out! Steve
... View more
08-11-2015
09:41 AM
|
0
|
1
|
1781
|
|
POST
|
Tracy Schloss If you follow what I was throwing out there, it should be var app = []; not var app = {};
... View more
08-11-2015
07:50 AM
|
0
|
0
|
2900
|
|
POST
|
Is there any reason why you just don't declare codeList as a global variable? Stands to reason this is why it probably worked when everything was in one long JS file. Either declare it at the top of your myMap.js file (outside of the requires): var codeList = []; or if you don't like lots of individual global variables, create a single global object and then create/update codeList as you need to at the module level: Create global object in myMap.js before requires: var app = [];
app.codeList = []; Create/update values down at the module level: app.codeList.push({... I've been really getting my feet wet lately with migrating my legacy JS over to AMD and, although it's entirely possible that I'm doing this wrong, I'm not returning anything from my created AMD modules: define ([
"dojo/_base/declare",
"esri/tasks/PrintTemplate",
"esri/tasks/PrintParameters",
"esri/tasks/PrintTask"
], function (
declare, PrintTemplate, PrintParameters, PrintTask
) {
return declare(null,{... I've had some issues when I want to pass a value WITHIN a module from one function to another (i.e. two levels down and trying to use this) but I generally find my module approach and the app.[object] approach works well enough for what I've been trying to do. Again, maybe I'm missing something or being a bit too simplistic.
... View more
08-10-2015
03:49 PM
|
0
|
1
|
2900
|
|
POST
|
Are you using a global "app" object variable for your application to handle global properties? if so, store the map reference as an object during your initial map creation: var app = [];
app.map = New Map(...); And then in your infoWindow.js reference tie into the map using your app variable: }, query(".sizer", app.map.infoWindow.domNode)[1]); Steve
... View more
08-07-2015
03:02 PM
|
0
|
0
|
1684
|
|
POST
|
This is a bit simplistic but your Search Results box is an HTML element so you can pull out the contents if you know the name of the HTML element. Assuming the ID is "searchResults": var theResults = document.getElementById("searchResults").innerText; //or innerHTML (whichever works best) Now populate it in your print template using the same technique: theDocument.getElementById("searchResultsContent").innerHTML = theResults; There will be some trial and error to get the content and to format it the way you want it.
... View more
08-04-2015
10:25 AM
|
0
|
1
|
8451
|
|
POST
|
In the interest of full disclosure, my approach is a simplified version of what you can do behind the scenes with ArcGIS Server where you have the ability to create/edit map templates that your end user can select from when they click a print map button. I haven't done this because, within my organization, I don't really have access to the location where these templates are stored. Anyways here's a link and link from the Help Docs about this. This gets a little confusing for me but between the Help doc and some forum searches about it, you'll get a better idea about pursuing that option.
... View more
08-04-2015
09:28 AM
|
0
|
3
|
8451
|
|
POST
|
Having not seen your application, I don't know if this will work for you but here's what I have done for one of my applications to add a "print map" functionality. I decided to create a print template built on HTML elements and then add the JPEG result of the PrintTask once it completes. Here's a screen shot of the simple map template of HTML elements: And then once the PrintTask is completed, the resulting JPEG is inserted into a particular DIV element on the page for the final map: Granted, you'll spend some quality time up front coming up with the HTML template but the rest of the code isn't much. You'll notice some extra code that selectively turns on/off legend elements based on what the user currently has visible when they clicked my print map button: var html;
define ([
"dojo/_base/declare",
"esri/tasks/PrintTemplate",
"esri/tasks/PrintParameters",
"esri/tasks/PrintTask"
], function (
declare, PrintTemplate, PrintParameters, PrintTask
) {
return declare(null,{
returnPrintMapTemplate: function() {
html ='your HTML template goes here';
return html;
},
createPrintedMap: function(userTitle) {
//The new browser window must be opened in the function called by the 'onClick' event so
//the new window is created here and its associated variable is created with a global scope.
//Calculate the center of the screen for placement of the new window
var center_left = (screen.width / 2) - (1100 / 2);
var center_top = (screen.height / 2) - (600 / 2);
newWindow = window.open('mapPrint.html','mywindow','width=1100,height=600,menubar=yes,scrollbars=yes,left=' + center_left + ',top=' + center_top);
//Create the string based version of the HTML page template
var bodyContent = this.returnPrintMapTemplate();
//Open the new window and obtain a reference to it's DOM
theDocument = newWindow.document;
//Swap out the empty DOM of the browser for a string based version of the HTML template
theDocument.open("text/html","replace");
theDocument.write(bodyContent);
theDocument.close();
//Now begin editing/adding page elements as needed
if (userTitle.length > 0) {
theDocument.getElementById("prjName").innerHTML = userTitle;
} else {
theDocument.getElementById("prjName").innerHTML = "Project Vicinity";
}
censusOn = false;
if (document.getElementById("raceTractBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Minority Population Data:";
theDocument.getElementById("prjLimits").innerHTML = "Minority Population by Census Tract";
censusOn = true;
}
if (document.getElementById("raceBlockBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Minority Population Data:";
theDocument.getElementById("prjLimits").innerHTML = "Minority Population by Block Group";
censusOn = true;
}
if (document.getElementById("incomeTractBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Low Income Data:";
theDocument.getElementById("prjLimits").innerHTML = "Low Income Population by Census Tract";
censusOn = true;
}
if (document.getElementById("incomeBlockBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Low Income Data:";
theDocument.getElementById("prjLimits").innerHTML = "Low Income Population by Block Group";
censusOn = true;
}
if (document.getElementById("lepTractBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Limited English Proficiency Data:";
theDocument.getElementById("prjLimits").innerHTML = "Limited English Proficiency by Census Tract";
censusOn = true;
}
if (document.getElementById("lepBlockBtn").checked) {
theDocument.getElementById("censusThemeName").innerHTML = "Limited English Proficiency Data:";
theDocument.getElementById("prjLimits").innerHTML = "Limited English Proficiency by Block Group";
censusOn = true;
}
if (!censusOn) {
theDocument.getElementById("censusDataLegend").style.display = "none";
theDocument.getElementById("prjLimits").innerHTML = "Project Vicinity";
if (document.getElementById("tractBtn").checked) {
theDocument.getElementById("prjLimits").innerHTML = "Census Tract Boundaries";
}
if (document.getElementById("bgBtn").checked) {
theDocument.getElementById("prjLimits").innerHTML = "Block Group Boundaries";
}
} else {
theDocument.getElementById("censusDataLegend").style.display = "inline";
}
if ((!document.getElementById("tractBtn").checked) || (!document.getElementById("bgBtn").checked)) {
theDocument.getElementById("censusBoundaryLegend").style.display = "none";
}
pTemplate = new PrintTemplate();
pTemplate.exportOptions = {
width: 638,
height: 609,
dpi: 96
};
pTemplate.format = "jpg";
pTemplate.layout = "MAP_ONLY";
pTemplate.preserveScale = false;
pTemplate.showAttribution = false;
var params = new PrintParameters();
params.map = app.map;
params.template = pTemplate;
jpgMapDiv = theDocument.getElementById("mapAreaBlock");
pPrintTask = new PrintTask(url);
pPrintTask.execute(params, function(result) {
jpgMapDiv.innerHTML = "<img src=\"" + result.url + "\" \>";
newWindow.alert('Your map is ready!\n\nIn order to print this map properly, please use the following recommended settings under Print Setup:\n\n\u2022 Landscape orientation\n\u2022 0.25" margins\n\u2022 "Print Background Colors and Images" is checked');
});
},
getMapTitle: function() {
$("#freeow").empty();
theModalDlg = document.getElementById("mapTitleDialog");
theContent = theModalDlg.innerHTML;
theDialogTitle = 'Please provide a map title <span style="font-style:italic">(30 characters Max):</span>';
$("#freeow").freeow(theDialogTitle, theContent, {
classes: ["smokey"],
autoHide: false,
autoHideDelay: 5000
}).show();
},
adjustCharLeftLabel: function() {
theTitleTextbox = document.getElementById("txtMapTitle");
curTitle = theTitleTextbox.value;
charsLeft = 30 - curTitle.length;
if (charsLeft < 10) {
document.getElementById("lblCharsLeft").style.color = "red";
} else {
document.getElementById("lblCharsLeft").style.color = "white";
}
document.getElementById("lblCharsLeft").innerHTML = charsLeft + " characters remaining";
},
screenMapTitle: function() {
theTitleTextbox = document.getElementById("txtMapTitle");
curTitle = theTitleTextbox.value;
if (curTitle.length > 30) {
$("#freeow").freeow("Whoops!", 'Your map title is more than 30 characters in length. Please revise and try again.', {
classes: ["simple"],
autoHide: true,
autoHideDelay: 5000
}).show();
} else {
$("#freeow").empty();
app.pf.createPrintedMap(curTitle);
}
}
});
}); Steve
... View more
08-04-2015
08:49 AM
|
1
|
5
|
8451
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Thursday | |
| 1 | Thursday | |
| 1 | a week ago | |
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago |