terenceng2010 / jsapi-workaround Goto Github PK
View Code? Open in Web Editor NEWbecause the happy way does not work
because the happy way does not work
VERSION: 3.20
version: 4.6
problem: cannot print sceneview
Ref: https://developers.arcgis.com/javascript/latest/sample-code/widgets-print-vectortiles/index.html
workaroud:
queryTask.requestOptions = {usePost:true}
no solution
solution:
it is named createExportImageParameters
Issue:
Referring to the official doc (http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Sample_Export_active_view/000100000026000000/) , but the export PDF is blank, as mentioned here: https://gis.stackexchange.com/questions/189116/exporttopdf-creates-blank-pdf
Solution:
It is due to the processing space issue. (https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#AppAutomation.htm)
To fix it, Both the ExportPDF and the PrintAndExport class has to be created by the IObjectFactory.
VERSION: 3.20
while editor-show is captured.
need a workaround...or FeatureTable is broken and 3rd party plugin needs to be used instead.
if mapImageLayer's sublayers are defined by definitionexpression of same layerId with client-side render self-defined simplefill colors, Legend Widget only get the one of the sublayer's color to apply to all sublayers in that mapImageLayer. It is an ArcGIS Server Dynamic Legend function issue.
you have to define the source property in each sublayer.
REF: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source
workaround: export result feature class to GDB instead.
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo
There is no support for labeling in 2D. Labeling is only supported in 3D SceneViews.
https://developers.arcgis.com/javascript/3/jsapi/search-amd.html mentioned searchQueryParams
can be defined to override properties like maxAllowableOffset. but it does not work
workaround:
edit search.js
location: library\3.20\3.20\esri\dijit\Search.js
add the below after (h.maxAllowableOffset=n);
if(e.searchQueryParams && e.searchQueryParams.maxAllowableOffset){ h.maxAllowableOffset = e.searchQueryParams.maxAllowableOffset }
VERSION: 3.20
It returns adds,updates,deletes instead.
//this does not work, see https://community.esri.com/thread/192089-how-do-i-find-the-extent-of-an-array-of-graphics-in-js-api-4x
//this.mapView.extent = layer.fullExtent;
//use mapView.goTo instead
this.mapView.goTo(layer.graphics);
highlightEnabledBoolean
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled
workaround (feature layer):
https://community.esri.com/thread/183372-jsapi-40-popup-set-highlight-graphic-on-feature-layer-click
workaround (map image layer):
view.popup.on("trigger-action", function(event){
var fillSymbol = {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: [227, 139, 79, 0.8],
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 255, 255],
width: 1
}
};
view.graphics.removeAll();
console.log(view.popup.content.graphic)
var polygonGraphic = new Graphic({
geometry: view.popup.content.graphic.geometry,
symbol: fillSymbol
});
view.graphics.add( polygonGraphic);
});
ie11 in windows 8 and upper, pan does not work properly due to additional touch events. (work in win 7 ie11)
workaround: disable touch-events emission for ie11:
js:
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if(isIE11){
delete window.PointerEvent;
window.navigator.msPointerEnabled = false;
}
css:
.map{
-ms-touch-action: none;
-ms-touch-select: none;
-ms-user-select: none;
}
ref:
https://stackoverflow.com/questions/29752190/ol3-with-ie11-in-a-c-sharp-webbrowser-control-mouse-click-events-not-working
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/dev-guides/dn394063(v=vs.85)
Access from Analysis => Tools => Create Vector Tile Package
The Data frame needs to have description.
Uncheck Package for ArcGIS Online...
if using HK1980.
ref: https://developers.arcgis.com/javascript/latest/sample-code/animation-layer-visibility/index.html
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
if(genSMS){
this.panAndZoomTo(startLocation.Location.x, startLocation.Location.y)
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
.then(()=>{
log.log('ss 1')
return this.mapView.takeScreenshot()})
.then((screenshot)=>{
screenshots.push(screenshot.dataUrl);
log.log('pz 2')
return this.panAndZoomTo(endLocation.Location.x, endLocation.Location.y)
})
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
.then(()=>{
log.log('ss 2')
return this.mapView.takeScreenshot()
}).then((screenshot)=>{
screenshots.push(screenshot.dataUrl);
var win = window.open("", "Title", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=780,height=200,top="+(screen.height-400)+",left="+(screen.width-840));
var firstHTML = `<img src="${screenshots[0]}"/><br>`;
var fifthHTML = `<img src="${screenshots[1]}"/><br>`;
var html = `
<html>
<head>
<meta charset="UTF-8">
</head>
${firstHTML}
${fifthHTML}
</html>
`;
log.log(html);
win.document.body.innerHTML = html;
});
}
Solution: you need to override the underlying createQuery method.
i.e
console.log(someMapImageLayer.sublayers)
if(someMapImageLayer.sublayers && someMapImageLayer.sublayers.items
&& someMapImageLayer.sublayers.items[0]){
let targetSubLayer = someMapImageLayer.sublayers.items[0];
//override sublayer createQuery to sort by SOME_DATE in popup template
targetSubLayer.createQuery = function() {
return new Query({
orderByFields : ['SOME_DATE'],
returnGeometry: !0,
where: someMapImageLayer.sublayers[0] || "1=1"
})
}
}
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html
font: {
// autocast as new Font()
size: "16pt",
"weight": "normal", //must follow
"style": "normal", //must follow
"variant": "normal", //must follow
"family": "PMingLiU" // for chinese character printing. also ensure the arcgis server locale is also set to chinese traditional.
}
workaround: use SQL syntax for expression
https://aa-egis.esrichina.hk/arcgis/sdk/rest/index.html#/Labeling_objects/02ss00000014000000/
VERSION: >= 3.11
workaround: use 3.10. But this is a bad workaround.
to the endpoint:
/portal/sharing/generateToken
solution:
pass post request with body like this:
params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'https://serverName'}
username=username&password=password&referer=https://serverName&f=pjson
esri\tasks\Geoprocessor.js
issue: cannot pass timeout valuve when execute gp, and IE default timeout valuve for ajax called is 1 minute only.
workaround:
override Geoprocessor.js execute function and add timeout value
execute: function (a, c, b, e) {
var d = this._getOutSR(),
g = e.assembly; a = this._gpEncode(h.mixin({}, this._url.query, { f: "json", "env:outSR": d ? d.wkid || n.toJson(d.toJson()) : null, "env:processSR": this.processSpatialReference ? this.processSpatialReference.wkid || n.toJson(this.processSpatialReference.toJson()) : null }, a), null, g && g[0]); var f = this._executeHandler, k = this._errorHandler; return l({ timeout:1000000,url: this._url.path + "/execute", content: a, callbackParamName: "callback", load: function (a, d) { f(a, d, c, b, e.dfd) }, error: function (a) { k(a, b, e.dfd) } })
}
symptom: message shown when start service with the soe:
Error HRESULT E_FAIL has been returned from a call to a COM component.
workaround:
solution:
check in the arcgis server, is all old arcgis_data_store connection removed?
VERSION: 3.20
arcgis server feature service bug, the below is workaround snippet
//working around an arcgis server feature service bug. Requests to queryRelatedRecords operation fail with feature service 10.
//Detect if request conatins the queryRelatedRecords operation and then change the source url for that request to the corresponding mapservice
esriRequest.setRequestPreCallback(function(ioArgs) {
if (ioArgs.url.indexOf("queryRelatedRecords") !== -1) {
ioArgs.url = ioArgs.url.replace("FeatureServer", "MapServer");
}
return ioArgs;
});
https://developers.arcgis.com/javascript/3/jssamples/ed_relatededits.html
make sure you uncheck z-values, if you are not storing 3D data!
dpi set to 300 from 96. need to hack into print widget internal printtemplate exportOptions
need to use legacy declaration.
VERSION : 3.20
https://developers.arcgis.com/javascript/3/jsapi/polyline.html
Issue:
SqlGeometry intersectionPoint = conn.ExecuteScalar<SqlGeometry>(strSql, new { STREET1 = street1, STREET2 = street2 });
and it throw "Object must implement IConvertible"
Solution:
You need to ensure to use a working Microsoft.SqlServer.Types version.
With trial-and-error, it is found that:
if you are pointing to SQL Server 2012 or 2019,
you may use Microsoft.SqlServer.Types v11
Also, you must add the following to the connection string:
Type System Version=SQL Server 2012
solution: use full azure internal cloudapp.net domain.
e.g YOUR_SERVER_NAME.RANDOM_STRING_BY_AZURE.hx.internal.cloudapp.net
popupDebug.features = popupDebug.features.slice().reverse(); window.setTimeout( function(){popupDebug.featureMenuOpen = true},1);
enterprise geodatabase version is primarily used by Esri Support to troubleshoot issues; it does not entirely reflect the functionality available to you, as a lot of geodatabase functionality is implemented in the clients that access the geodatabase and not in the geodatabase itself.
For enterprise geodatabases, the geodatabase version mostly only reflects what software version you used to create or upgrade the geodatabase.
https://desktop.arcgis.com/en/system-requirements/latest/databases-in-the-cloud.htm
And you only need make sure the azure sql cloud version is compat with the geodatabase.
https://support.esri.com/en/technical-article/000017062
--->not too much to be aware of from deprecation notice
ArcGIS Enterprise 10.9.1 Issues Addressed List - Page 13 - Enterprise Geodatabase
https://downloads.esri.com/support/downloads/other_/1091-IssuesAddressedList_111921.pdf
--> there are some bug fixes for enterprise geodatabase on azure sql. It's fine.
ArcGIS Enterprise 10.9 Issues Addressed List - Page 12 - Enterprise Geodatabase
https://downloads.esri.com/support/downloads/other_/109-IssuesAddressedList-081021.pdf
--> some bug fixes for enterprise geodatabase upgrade from 10.7.1 to 10.8.1. It's fine.
ArcGIS 10.8.1 Issues Addressed List - Page 6
https://downloads.esri.com/support/downloads/other_/1081-IssuesAddressedList-072420.pdf
--> bug BUG-000126821 - Upgrading an SDE schema geodatabase to version 10.6 or later as the SDE user fails with a -37 error if the geodatabase contains feature classes with non-versioned archiving. will be an issue if someone tries to upgrade to 10.8 from >= 10.6
ArcGIS 10.8 Issues Addressed List - Page 5
https://downloads.esri.com/support/downloads/other_/108-IssuesAddressedList-02132020.pdf
---> nothing special to note.
ArcGIS 10.7.1 Issues Addressed List - Page 5
https://downloads.esri.com/support/downloads/other_/1071-IssuesAddressedList-06212019.pdf
---> nothing special to note.
ArcGIS 10.7 Issues Addressed List - Page 11
https://downloads.esri.com/support/downloads/other_/107-IssuesAddressedList-03182019.pdf
---> First version to support azure sql
Use the latest arcmap/ arcgis pro to create the latest enterprise geodatabase to have less bugs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.