|
POST
|
we absolutely break out our modules. For example, in index.html, i call a "createAerialDownload" function function createAerialDownload(){
var aerialDownload = new org.mymanatee.dijit.AerialDownloadWidget({
map: map
}, 'aerialDownloadDiv');
this.aerialDownload = aerialDownload;
aerialDownload.startup();
on(aerialDownload, "onError", function(error) {
console.log(error);
});
} and then in a seperate file i have my module require([
"dijit/Dialog", "dojo/_base/declare", "dojo/parser", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/_base/xhr", "dojo/_base/lang",
"dojo/_base/connect", "dojo/dom", "dijit/registry", "dojo/dom-construct", "dojo/query", "dojo/on","dojo/has", "dojo/dom-style","dojo/io-query","dojo/_base/array","utilities/latlong"
],
function(Dialog, declare, parser, _Widget, _Templated, xhr, lang,
connect, dom, registry, domConstruct, query,on, has,domStyle,ioQuery, array, latlong) {
declare("org.mymanatee.dijit.AerialDownloadWidget",[_Widget, _Templated],
{
constructor: function(/*Object*/ params) {
},
_module: "org.mymanatee.dijit",
templatePath: require.toUrl("org/mymanatee/dijit/templates/AerialDownloadWidget.html"),
postMixInProperties: function(){
this.inherited(arguments);
},
postCreate:function()
{
this.inherited(arguments);
parser.parse(this.domNode);
// Init the loader animation
},
startup: function(){
this.inherited(arguments);
try {
if(!this.configData){
xhr.get( {
url: "org/mymanatee/dijit/config/AerialDownloadWidget.json",
handleAs: "json",
sync:true,
load: lang.hitch(this, function(responseObject, ioArgs) {
this.configData = responseObject;
this.loadOptions();
}),
error:function(error) {
alert('error loading json');
}
});
}
}
catch (err) { console.error(err); }
connect.connect(dom.byId("exportAerial"), "click", this, "exportAerial");
},
loadOptions:function(){
var aerialYears = registry.byId('aerialDownloadYearSelector');
array.forEach(this.configData.years, function(y){
aerialYears.addOption({label:y.year,value:y.year});
});
},
exportAerial:function(){
var format = "jpg";
switch (registry.byId('aerialDownloadFormatSelector').value) {
case 'JPG':
format = "jpg";
break;
case 'PNG':
format = "png";
break;
case 'BMP':
format = "bmp";
break;
case 'GIF':
format = "gif";
break;
case 'MrSID':
format = "sid";
break;
default:
format = "jpg";
break;
}
var catalog = registry.byId('aerialDownloadYearSelector').value;
var filename = (registry.byId('aerialFilenameTextInput').value);
if(!filename){
filename = "ManateeCountyAerial"+catalog+"."+format;
}else{
filename.split('.')[0];
}
//lowerleft
var LL = latlong.convertWebMercAuxtoLL(map.extent.xmin, map.extent.ymin);
//upperright
var UR = latlong.convertWebMercAuxtoLL(map.extent.xmax, map.extent.ymax);
//to state plane
var LLSP = latlong.convertLLtoSP_TM(LL[0],LL[1]);
var URSP = latlong.convertLLtoSP_TM(UR[0],UR[1]);
var bbox = LLSP[0]+","+URSP[1]+","+URSP[0]+","+LLSP[1];
var url = window.location.protocol+"//www.mymanatee.org/lizardtech/iserv/catalogs/"+catalog+"/"
+"iserv-catalog-index/cmd/getimage/method/crop/bg/000000/oif/"+format+"/geo/true/rgn/"+bbox+"/lev/0/wid/"+map.width+"/hei/"+map.height+"/outputfilename/test."+format;
window.open(url);//
},
shutdown:function()
{
this.setMessage();
this.inherited(arguments);
}
});
});
... View more
11-08-2013
04:28 AM
|
0
|
0
|
2004
|
|
POST
|
as far as i know, to use the print task all your services must be publicly accessable
... View more
10-25-2013
12:40 PM
|
0
|
0
|
2315
|
|
POST
|
Is your IIS directly exposed to the internet/ in a DMZ? if so then yes, there are some json hijacking concerns http://security.stackexchange.com/questions/7001/how-should-web-app-developers-defend-against-json-hijacking I for one (besides the obvious dont use IIS) would recommend installing your application behind a Web Application Firewall and making sure you are doing request filtering to guard against attacks and exploits We use mod-proxy http://httpd.apache.org/docs/2.2/mod/mod_proxy.html and keep our tomcat server internal allowing things only as necessary.
... View more
10-25-2013
12:19 PM
|
0
|
0
|
1316
|
|
POST
|
onStreetViewVisibilityChange: function(turnOff) {
// alert('herechange');
if(dojo.isChrome){
if(turnOff){
if(dojo.byId('map_Google Road')){
dojo.style(dojo.byId('map_Google Road'),'zIndex','15');
if(dojo.byId('gmaps_controls_')){
dojo.style(dojo.byId('gmaps_controls_'),'display','none');
}
}
}else{
if(dojo.byId('gmaps_controls_')){
dojo.style(dojo.byId('gmaps_controls_'),'zIndex','15');
dojo.style(dojo.byId('gmaps_controls_'),'display','block');
}
if(dojo.byId('map_Google Road')){
dojo.style(dojo.byId('map_Google Road'),'zIndex','0');
}
}
}
},
... View more
10-18-2013
09:39 AM
|
0
|
0
|
3065
|
|
POST
|
why are you saving out the hombutton.js instead of just calling it? require(["esri/dijit/HomeButton", ... ], function(HomeButton, ... ){ ... });
... View more
10-16-2013
07:57 AM
|
0
|
0
|
2672
|
|
POST
|
FWIW, I've found the opposite and I'm using jQuery in my "boilerplate" now. Is there any reason NOT to use it? So many 3rd party frameworks and plugins rely on jQuery, so it seems logical to use it...... For me the reasons not to use it were 1. One less library to load 2. One less framework to learn These reasons might not be valid for you. There is no technological reason not to use it.
... View more
10-14-2013
06:06 AM
|
0
|
0
|
880
|
|
POST
|
we use netbeans, so i don't have code assist. To be honest, I think it has made (forced) me to learn the API more thoroughly. You loose a lot of handholding/drag and drop/gui/styling etc.. by not using Flex. But you gain control and security. Totally worth it to me. As far as the jquery/dojo thing, i found myself recently forcing jquery OUT of my code and doing everything in dojo. Think I am better off for that as well, but i don't know jquery very well either. I have yet to find something dojo could not do. Finally, We still support IE7. I recently had to wedge client side pdf rendering and printing into ie7 without canvas elements. I ended up using flashcanvas instead of excanvas due to image support. If we ever get to full html5/js I will be a much happier camper.
... View more
10-11-2013
12:53 PM
|
0
|
0
|
880
|
|
POST
|
i have to say i have noticed a decline in firefox performance as well
... View more
10-11-2013
11:04 AM
|
0
|
0
|
1859
|
|
POST
|
i would/will never write a native app. 1. Licensing 2. Multiple code bases to maintain 3. Testing constraints 4. etc..
... View more
10-11-2013
10:59 AM
|
0
|
0
|
1737
|
|
POST
|
Agreed on Javascript. Flex ruled and by security and being dropped on mobile anyway Silverlight was a non-started. The whole web is migrating to JS/HTML5. I get calls (frequently) that start with "we our migrating our app from <flex/silverlight> to javascript and... " Just glad I got ahead of the curve.
... View more
10-11-2013
10:17 AM
|
0
|
0
|
3783
|
|
POST
|
I appreciate the insight. I agree with #2, i lazy load in the background but maybe I shouldn't unless its needed. Still think I should be able to load in the background.,.
... View more
10-11-2013
05:41 AM
|
0
|
0
|
1694
|
|
POST
|
So I have an Accordian Pane, in an Accordian Container, in a TabContainer, in an ExpandoPane If I load an edit widget, the editbar loads, but the template picker is empty. No amount of refreshing it makes it populate. HOWEVER If I click on the Editing Tab quick enough so that the pane is visible when the editor dijit creates, it loads fine. ?????? Code for editorWidget createEditing: function(fArray){ var layers = dojo.map(fArray, function(layer) { var fieldInfos= dojo.map(layer.fields,function(field){ if(field.name === 'description'){ return {'fieldName': field.name,'label':'Details'}; } else{ return {'fieldName': field.name,'label':field.alias}; } }); return {featureLayer:layer,'fieldInfos':fieldInfos}; }); var settings = { map: map, enableUndoRedo:true, layerInfos:layers, toolbarVisible: true, createOptions: { polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON, esri.dijit.editing.Editor.CREATE_TOOL_AUTOCOMPLETE ] }, toolbarOptions: { reshapeVisible: true, cutVisible: true, mergeVisible: true } }; var params = {settings: settings}; editorWidget = new esri.dijit.editing.Editor(params,'editorDiv'); editorWidget.startup(); } link to live http://www.mymanatee.org/gisapps/mapviewer/mobile/mobiletest.html
... View more
10-10-2013
12:00 PM
|
0
|
5
|
2480
|
|
POST
|
oh ok i see the difference. Yes I would actually like to display
... View more
10-07-2013
10:44 AM
|
0
|
0
|
894
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-22-2014 08:35 AM | |
| 1 | 05-02-2012 04:56 AM | |
| 1 | 10-29-2021 07:40 AM | |
| 1 | 10-28-2021 05:26 AM | |
| 1 | 07-17-2012 08:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-01-2022
02:00 PM
|