-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug in switch between planar/geodesic measure
The wkid for mercator SpatialReference in esri Js is NOT the EPSG code (3857) but 102100.
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
005356e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeremie, you are awesome as always for fast response!~ We all love your widget and use it in all our viewers.
I tried the new widget.js. I am not seeing any measurement now though. Console says:
Uncaught TypeError: Cannot read property 'MeasureSymbol' of undefined
at Object._getTxtGraphic (Widget.js?wab_dv=2.9:1828)
at Object.addMeasure (Widget.js?wab_dv=2.9:1875)
at Object.drawBoxOnDrawEnd (Widget.js?wab_dv=2.9:1407)
at Object. (init.js:64)
at Object.c [as onDrawEnd] (init.js:120)
at Object._onDrawEnd (DrawBox.js?wab_dv=2.9:489)
at Object. (init.js:64)
at Object. (init.js:666)
at Object.c [as onDrawEnd] (init.js:120)
at Object._drawEnd (draw.js:18)
_getTxtGraphic @ Widget.js?wab_dv=2.9:1828
addMeasure @ Widget.js?wab_dv=2.9:1875
drawBoxOnDrawEnd @ Widget.js?wab_dv=2.9:1407
(anonymous) @ init.js:64
c @ init.js:120
_onDrawEnd @ DrawBox.js?wab_dv=2.9:489
(anonymous) @ init.js:64
(anonymous) @ init.js:666
c @ init.js:120
_drawEnd @ draw.js:18
_onMouseUpHandler @ draw.js:31
(anonymous) @ init.js:64
c @ init.js:120
_fire @ init.js:1363
_onDragMouseUpHandler @ init.js:1369
(anonymous) @ init.js:64
005356e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so I fixed it. I had to insert the additions and subtractions manually. I am guessing there was a slight syntax error in your widget.js. You can use this it works:
///////////////////////////////////////////////////////////////////////////
// Copyright © MAGIS NC. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
define([
'dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'dojo/Deferred',
'dojo/aspect',
'dojo/_base/lang',
'dojo/on',
'dojo/_base/html',
'dojo/sniff',
'dojo/_base/Color',
'dojo/_base/array',
'dojo/dom-construct',
'dojo/dom',
'dijit/form/Select',
'dijit/form/NumberSpinner',
'libs/storejs/store',
'esri/config',
'esri/InfoTemplate',
'esri/graphic',
'esri/graphicsUtils',
'esri/layers/GraphicsLayer',
'esri/toolbars/edit',
'esri/units',
'esri/SpatialReference',
'esri/geometry/Polyline',
'esri/geometry/Polygon',
'esri/geometry/geometryEngine',
'esri/geometry/projection',
'esri/symbols/SimpleMarkerSymbol',
'esri/symbols/SimpleLineSymbol',
'esri/symbols/SimpleFillSymbol',
'esri/symbols/TextSymbol',
'esri/symbols/Font',
'jimu/exportUtils',
'jimu/dijit/ViewStack',
'jimu/dijit/SymbolChooser',
'jimu/dijit/DrawBox',
'jimu/dijit/Message',
'jimu/utils',
'jimu/symbolUtils'
],
function(
declare, _WidgetsInTemplateMixin, BaseWidget,
Deferred, aspect, lang, on, html, has, Color, array, domConstruct, dom, Select, NumberSpinner, localStore,
esriConfig, InfoTemplate, Graphic, graphicsUtils, GraphicsLayer, Edit,
esriUnits, SpatialReference, Polyline, Polygon, geometryEngine, projection,
SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, TextSymbol, Font,
exportUtils, ViewStack, SymbolChooser, DrawBox, Message, jimuUtils, jimuSymbolUtils
) {
});