Starting from ArcGIS JS 4.x, under some special conditions, the MapView will have a blue border when the MapView is focus, who genius get this geneless idea?
To get rid of this stupid box, style the following:
.esri-view-surface--inset-outline::after {
outline: none !important;
padding: 0px !important;
}
So when this stupid design will come out? When ever your HTML got the following conditions, that stupid box will be shown when MapView is on focus:
body {
margin: 0;
}
#mapDiv {
width: 100%
}
... The most weird API ever encountered
Showing posts with label arcgis. Show all posts
Showing posts with label arcgis. Show all posts
Sunday, August 19, 2018
Friday, July 20, 2018
Updating graphic in ArcGIS JS 4.x GraphicsLayer
Esri still don't have a clue on how to modify a graphic in GraphicsLayer directly at version 4.8.
You still need to clone the graphic, remove the existing one, and add the new one to realize the modification.
Ref:
https://developers.arcgis.com/javascript/latest/guide/functionality-matrix/index.html#graphicslayer
Stone age API.
Wednesday, March 7, 2018
Map server URL with query parameters in ArcGIS JS 4.6
Starting from ArcGIS JS 4.6, the map server URL should not have any query parameters. Any query parameters exists in the map server URL will be removed.
To handle this issues, you can override the urlUtils.removeQueryParameters() as below
require(["esri/core/urlUtils"], function(urlUtils) {
urlUtils.removeQueryParameters = function(a){
return a;
};
});
But somehow that's a bad trick. A better way is to use the TileLayer._set() to get rid of the parameters stripping action when setting the URL. i.e.
TileLayer._set('url', 'map_server_url')
To handle this issues, you can override the urlUtils.removeQueryParameters() as below
require(["esri/core/urlUtils"], function(urlUtils) {
urlUtils.removeQueryParameters = function(a){
return a;
};
});
But somehow that's a bad trick. A better way is to use the TileLayer._set() to get rid of the parameters stripping action when setting the URL. i.e.
TileLayer._set('url', 'map_server_url')
Using Proxy with ArcGIS JS
For servers without CORS enabled. We can use proxy mechanism to access the services.
This is done by modifying the proxy.ashx.
You can also add any parameters before sending the request to the actual server.
More references could be found at:
https://developers.arcgis.com/javascript/latest/guide/proxies/index.html
Thursday, August 17, 2017
OpenLayers blurry map with ArcGIS tiles
Check this out:
https://github.com/openlayers/openlayers/issues/6430
Thursday, November 12, 2015
Leaflet vs ArcGIS JS / FeatureLayer
I'd been deciding ESRI-Leaflet or ArcGIS JS for a small project. Some findings for our references:
When using FeatureLayer for plenty amount of data (e.g. vast amount of points), ArcGIS JS performs better than Leaflet. So even the file size of Leaflet is far smaller than ArcGIS JS, I still have to choose the larger one.
Hope Leaflet FeatureLayer performance can boost up in future.
When using FeatureLayer for plenty amount of data (e.g. vast amount of points), ArcGIS JS performs better than Leaflet. So even the file size of Leaflet is far smaller than ArcGIS JS, I still have to choose the larger one.
Hope Leaflet FeatureLayer performance can boost up in future.
Tuesday, November 4, 2014
ArcGIS: Query for a simplified feature set
To query a simplified feature set using QueryTask, you can set the "MaxAllowableOffset" property through
com.esri.core.tasks.ags.query.Query.setMaxAllowableOffset( )
or if you're using ArcGIS Android SDK version 10.2.4 already, then it should be:
com.esri.core.tasks.ags.query.QueryParameters.setMaxAllowableOffset( )
com.esri.core.tasks.ags.query.Query.setMaxAllowableOffset( )
or if you're using ArcGIS Android SDK version 10.2.4 already, then it should be:
com.esri.core.tasks.ags.query.QueryParameters.setMaxAllowableOffset( )
Sunday, March 2, 2014
ArcGIS Server Cached Map Expiry Time
The tiled cached map expire time can be controlled by a variable "cacheControlMaxAge" in ArcGIS Server Administrator Directory, available starting at ArcGIS for Server (Window) 10.2.
Ref: http://resources.arcgis.com/en/help/main/10.2/index.html#//015400000577000000
The default HTTP header "max-age" is 86400 (i.e. 24 hours), which seems cannot be changed in ArcGIS Server 10.0.
For Android SDK 10.2, the map caching activities only works on the particular session. That means when the user quit the app and start it again. The previous cache will not be used.
Ref: http://resources.arcgis.com/en/help/main/10.2/index.html#//015400000577000000
The default HTTP header "max-age" is 86400 (i.e. 24 hours), which seems cannot be changed in ArcGIS Server 10.0.
For Android SDK 10.2, the map caching activities only works on the particular session. That means when the user quit the app and start it again. The previous cache will not be used.
Monday, November 4, 2013
Customize the 404 page for ArcGIS Server Map Services
ArcGIS Server 10 internal Tomcat web root:
\ArcGIS\Server10.0\java\manager\web_output
ArcGIS Server 10 internal Tomcat conf:
\ArcGIS\Server10.0\java\manager\service\managerappserver\conf
\ArcGIS\Server10.0\java\manager\web_output
ArcGIS Server 10 internal Tomcat conf:
\ArcGIS\Server10.0\java\manager\service\managerappserver\conf
You may modify the web.xml by adding the error page definition:
...
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/404.htm</location>
</error-page>
</web-app>
And the 404 error file can put in the root (/web_output)
Wednesday, October 30, 2013
Remove the "Zoom to" link in Callout of ArcGIS Javascript API
We can add the following style to hide the "Zoom to" link:
.action.zoomTo {
display: none;
}
Ref:
http://forums.arcgis.com/threads/89318-Remove-quot-Zoom-to-quot-link
.action.zoomTo {
display: none;
}
Ref:
http://forums.arcgis.com/threads/89318-Remove-quot-Zoom-to-quot-link
Thursday, May 2, 2013
ESRI ArcGIS JS API version 3.4 hiding the Dojo Dnd style "dojoDndAvatar"
For ArcGIS JS API v3.4, if you include "esri.css" in your project, then your Dojo Dnd Avatar (the floating hints while you're doing drag and drop) will be disappeared.
Why? Because in "esri.css", esri.css got the following style:
.dojoDndAvatar {display: none;}
God... What the hell ESRI guys are doing ?!
Why? Because in "esri.css", esri.css got the following style:
.dojoDndAvatar {display: none;}
God... What the hell ESRI guys are doing ?!
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...
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
Sunday, December 18, 2011
Using ArcGIS JS API v2.5 - v2.8
Some notes on using their API:
Something more about the Javascript files in the API:
- In 2.5, the path is /library/2.5/arcgis (or arcgis_compact)
- In 2.6, the path changed to /library/2.6/jsapi (or jsapicompact), but the manual doesn't changed. So be careful when following the installation manual
- The file in /library/2.6/jsapi/js/esri/jsapi.js will create a Javascript error. You might need to replace the file content with the one in ESRI ArcGIS JS API production site.
Something more about the Javascript files in the API:
- The jsapi.js contains UTF8 characters (‰ - u8240, ¤ - u0164), when ArcGIS JS API "index.jsp" includes this file using <jsp:include>, the UTF8 characters will corrupted. I found two solutions for that
- Modify the jsapi.js, swap those UTF8 characters back to escaped (\u) characters, and save the file back as ANSI format. OR
- Modify the "index.jsp", avoid using <jsp:include>, try to use file reader with encoding specified. For example: FileUtils.readFileToString(new File(filepath_), "UTF8"); (where FileUtils is from org.apache.commons.io package)
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( ) ...