Code Monkey home page Code Monkey logo

jsapi-workaround's People

Contributors

terenceng2010 avatar

Watchers

 avatar  avatar

jsapi-workaround's Issues

[arcobjects] export pdf does not work when doing ArcMap automation in a standalone program

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.

[jsapi4] legend widget - wrong color in specific mapImageLayer

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

search widget searchQueryParams does not override properly as mentioned

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 }

[jsapi4] cannot show full extent of a GraphicsLayer.

             //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);

[jsapi4] highlight graphic feature with mapimagelayer or featurelayer does not work with 2D

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);
          }); 

[jsapi4] ie11 pan stutter

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)

[pro] Create Vector Tile Package quirk

Access from Analysis => Tools => Create Vector Tile Package

The Data frame needs to have description.
Uncheck Package for ArcGIS Online... if using HK1980.

[jsapi4] wait for every layer to fininsh drawing

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;                                          
                });
              }

[jsapi4] mapimagelayer - popuptemplate - how to sort multiple inspection results?

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"
                      })
                  }
                }

Ref:
https://stackoverflow.com/questions/17208268/how-to-find-out-which-javascript-causes-a-jquery-ajax-request

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createQuery

https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html

Geoprocessor cannot pass timeout value

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) } })
}

[arcgis server] soe deployed. service cannot start

symptom: message shown when start service with the soe:

Error HRESULT E_FAIL has been returned from a call to a COM component.

workaround:

  1. In the service property, uncheck the soe extension, save
  2. Start the service. the service should be started without the soe.
  3. Check the soe extension again, save
  4. This time the service can be started with the soe properly.

Query Feature Layer for related records does not work

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

dapper cannot retrieve SqlGeometry

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

Extra issue:
https://blog.developer.money/dapper-%E4%BD%BF%E7%94%A8-microsoft-sqlserver-types-%E6%89%BE%E4%B8%8D%E5%88%B0%E6%AD%A3%E7%A2%BA%E7%89%88%E6%9C%AC%E5%95%8F%E9%A1%8C-a7848b95b6e5

[arcgis enterprise] enterprise geodatabase compatibility (10.7 to 10.9.1)

In General...

https://enterprise.arcgis.com/en/server/latest/manage-data/windows/client-geodatabase-compatibility.htm

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.

In Reality

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

Conclusion

Use the latest arcmap/ arcgis pro to create the latest enterprise geodatabase to have less bugs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.