Just a quick notes on dojo 1.8. For example, if I want to use the Color object in dojo. I will:
var Color;
require(["dojo/_base/Color"], function(c) {
Color = c;
});
Then I can use the variable Color after the initialization is done. Am I correct? Should it be used in another way? :-)
Tuesday, September 11, 2012
Thursday, August 30, 2012
Upgrading from ArcGIS Android API v1.1 to v2.0
If you got a ArcGIS Android Project using ArcGIS API v1.1 and switch to v2.0, you will have a runtime exception when you do a pan action in the map view.
FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: nativeSetAnimating
com.esri.android.map.MapSurface.nativeSetAnimating(Native Method)
...
To solve this problem, you need to:
FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: nativeSetAnimating
com.esri.android.map.MapSurface.nativeSetAnimating(Native Method)
...
To solve this problem, you need to:
- Create a new ArcGIS Android project using v2.0
- Copy the files "libs/armeabi/libGLMapCore.so" and "libs/armeabi-v7a/libGLMapCore.so" back to your original v1.0 project directory
Tuesday, August 28, 2012
DOJO: Tab ordering in TabContainer
The tabContainer.getChildren( ) method returns a list of tab widget (ContentPane) in the container using the following way:
dijit.findWidgets(tabContainer.containerNode)
However, if you did some drag and drop actions on the tab button list to rearrange the tab ordering, the tab sequence did not changed actually. To get a modified / correct ordered list, you may try to override the getChildren( ) method:
myTabContainer.getChildren = function() {
var list = this.tablist.getChildren();
var rsltList = [];
for (var idx=0; idx<list.length; idx++) {
rsltList.push(list[idx].tab);
}
return rsltList;
}
Noticed the underlined "tab" member variable in the code, you need to manually assign it when your tab page is created. Or you may find a way / method to get the Tab page object (ContentPane) via the Tab Button.
If you got any better method, please let me know :-)
dijit.findWidgets(tabContainer.containerNode)
However, if you did some drag and drop actions on the tab button list to rearrange the tab ordering, the tab sequence did not changed actually. To get a modified / correct ordered list, you may try to override the getChildren( ) method:
myTabContainer.getChildren = function() {
var list = this.tablist.getChildren();
var rsltList = [];
for (var idx=0; idx<list.length; idx++) {
rsltList.push(list[idx].tab);
}
return rsltList;
}
Noticed the underlined "tab" member variable in the code, you need to manually assign it when your tab page is created. Or you may find a way / method to get the Tab page object (ContentPane) via the Tab Button.
If you got any better method, please let me know :-)
Thursday, August 23, 2012
Monday, June 18, 2012
Overriding window.open( ) in Javascript
Sometimes you may want override the window.open( ) in Javascript. It's strange, but you really it occasionally. Here is how we can do it:
var open_ = window.open;
window.open = function(url, name, opts) {
return open_(url, name, opts);
}
Then you can add your own checking / modifications right before the window is opened.
Monday, June 11, 2012
ArcGIS JS: Move a graphic to top
To move a graphic in a ArcGIS JS GraphicsLayer to top:
g.getDojoShape().moveToFront();
But this may breaks the onClick event of the GraphicsLayer, beware.
Updated: in ArcGIS JS API version 3.8, use getShape( ) instead. ESRI... no more stupid naming please...
g.getDojoShape().moveToFront();
But this may breaks the onClick event of the GraphicsLayer, beware.
Updated: in ArcGIS JS API version 3.8, use getShape( ) instead. ESRI... no more stupid naming please...
Thursday, May 31, 2012
Filter in Wireshark
Suppose you want to monitor the HTTP request from 192.168.0.1 to 202.168.1.2 with a particular URI (e.g. saveUserInfo/) using Wireshark, you can specify the above situation using the filter below:
ip.src == 192.168.0.1 and http.host = "202.168.1.2" and http.request.uri contains "saveUserInfo"
Quite handy :)
Monday, May 28, 2012
JSP too large for Tomcat
A long JSP just worked in Tomcat 6.0.29. Somehow when we put it in 6.0.35, it got error "Unresolved compilation problem".
It seems that the new Jasper (/lib/ecj-3.7.jar) just not work for large JSP. One of the solution will be using the Jasper from 6.0.29 (/lib/jasper-jdt.jar) instead.
Or.. keep using the 6.0.29 for some while...
It seems that the new Jasper (/lib/ecj-3.7.jar) just not work for large JSP. One of the solution will be using the Jasper from 6.0.29 (/lib/jasper-jdt.jar) instead.
Or.. keep using the 6.0.29 for some while...
Monday, May 14, 2012
Secure the ArcGIS Server
References for securing the ArcGIS server:
- http://blogs.esri.com/esri/arcgis/2010/06/23/five-things-to-consider-when-securing-arcgis-server/
- http://geochalkboard.wordpress.com/2010/12/13/using-a-proxy-page-with-the-arcgis-server-api-for-javascript/
- http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp/ags_proxy.htm#webprint
Saturday, April 28, 2012
Small HTTP servers for Windows
Some mini size HTTP server software for Windows:
So what about ProxyPass in nginx? I will try on it tomorrow. Keep update soon.
For nginx, if you want to add an alias which point to another location which is not under the root directory, you can put the following in the nginx.conf:
location /web {
alias d:/Code/nginx_web;
}
This means for locations http://yourhost/web, it is pointing to d:\Code\nginx_web actually.
So what about ProxyPass in nginx? I will try on it tomorrow. Keep update soon.
Subscribe to:
Posts (Atom)
CSP on Apache
To add CSP to root if sort of funny. The following will NOT work for most cases !! <LocationMatch "^/$"> Header s...
-
When Office2003 couldn't find file SKU011.CAB: regedit -> [HKEY_LOCAL_MACHINE] -> [SOFTWARE] -> [Microsoft] -> [Office] -...
-
The resolution can be changed by editing the BlueStack's registry: HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height and ...
-
Suppose you got a file in Big5 containing some HKSCS characters (e.g. 深水埗, 赤鱲角, etc). When your environment (Ref: Charset.defaultCharset( ) ...