question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MapInfo widget _setScale error

See original GitHub issue

An error occurs occasionally when the map loads in the MapInfo widget. TypeError: Cannot read property 'decimalFormat' of undefined It doesn’t happen regularly, but about every other time… I’ve tracked it down to dojo.number. To replicate set the mapInfo options to something like this:

                    proj4Catalog: 'EPSG', //'ESRI', 'EPSG' or 'SR-ORG' **
                    proj4Wkid: 3435, //wkid of the map ** // 4326
                    mode: 'dec', //'map', 'dec' or 'dms' // map
                    ...

Maybe I’m just doing something wrong…here’s my entire widget config. Also, the basemap is set to web mercator.

            mapInfo: {
                include: true,
                id: 'mapInfo',
                type: 'domNode',
                path: 'gis/dijit/MapInfo',
                srcNodeRef: 'mapInfoDijit',
                options: {
                    map: true, //required
                    mode: 'dec', //'map', 'dec' or 'dms' // map
                    firstCoord: 'y', //which coord to display first ('x')
                    unitScale: 2, //coord decimal places (2)(affects seconds in 'dms' format)
                    showScale: true, //show map scale (false)
                    showZoom: false, //show zoom level (false)
                    xLabel: 'X: ', //label for x coord ('X:')
                    yLabel: 'Y: ', //label for y coord ('Y:')
                    scaleLabel: '1:', //label for map scale ('1:')
                    zoomLabel: 'Z', //label for zoom level ('Z')
                    minWidth: 286, //minimum width in pixels of widget (0)(when 0 widget fits content)
                    proj4Catalog: 'EPSG', //'ESRI', 'EPSG' or 'SR-ORG' **
                    proj4Wkid: 3435 //wkid of the map ** // 4326
                }
            },

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tmcgeecommented, Jul 15, 2015

something like this:

_setScale: function () {
    var scale = this.map.getScale();
    if (scale === null || isNaN(scale)) {
        return;
    }
    html.set(this.scaleNode, String(number.format(number.round(scale, 0))));
},
0reactions
tmcgeecommented, Jul 18, 2015

fixed in #433

Read more comments on GitHub >

github_iconTop Results From Across the Web

MapInfo Pro - Precisely Knowledge Communities
"Ctrl Shift F" changing scale in mapper window. ... Mapinfo Drivetime tool overlapping region not working as intended, 3, 2022-09-26T09:01:00 by Raphael ...
Read more >
ScaleBar | API Reference | ArcGIS Maps SDK for JavaScript 4.25
The ScaleBar widget displays a scale bar on the map or in a specified HTML node. The widget respects various coordinate systems and...
Read more >
MapInfo Bing Aerial resolution/scale - GIS Stack Exchange
I am using MapInfo to display some Bing aerial photos. It seems as if it is using the wrong scale of imagery -...
Read more >
Solved: Query widget based on click - Esri Community
I need a widget that will query a work-order table based. ... //When features are associated with the map's info window update the...
Read more >
CCP4 Program Suite
readmap, deletemap, mapinfo, section ... Returns: 0 = completed ok -1 = map already loaded -2 = error reading from map file -3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found