Answered by:
DrawingTools. Bad latitude assignement drawing polygons

Question
-
Code from:
}, a.prototype._mapTapped = function(a) { if (1 === this._mode || 3 === this._mode) { var b = a.point, c = a.location, d = this._getPolyPoints(), e = this._xPixel, f = this._yPixel, g = d.x.length - 1; this._closeShape && g--; g = Math.max(g, 0); d.x[g] = d.x[g + 1] = c.longitude; d.y[g] = d.y[g + 1] = c.latitude; this._pixelsValid && (e[g] = e[g + 1] = b.x, f[g] = f[g + 1] = b.y); /**/ this._closeShape && (d.x[g + 2] = d.x[0], d.y[g + 2] = d.x[0], this._pixelsValid && (e[g + 2] = e[0], f[g + 2] = f[0])); this._hitTestIndexValid = !1; this.dirty.invoke(!1); this.drawingChanged.invoke(this._getShapeInternal()); }
Tuesday, April 4, 2017 4:38 PM
Answers
-
This is a known issue that has been resolved in the experimental branch of Bing Maps V8 and will be rolled into the main release branch around the end of April, beginning of May. You can add &branch=experimental to the map script URL to test this. Alternatively, you can workaround this issue by adding the following check:
var shape = [the polygon from drawing tools]; if (shape instanceof Microsoft.Maps.Polygon && shape.geometry.rings[0].y.length > 0) { shape.geometry.rings[0].y[shape.geometry.rings[0].y.length - 1] = shape.geometry.rings[0].y[0]; //Polygon is now fixed }
- Edited by Ricky_Brundritt Tuesday, April 4, 2017 6:30 PM
- Proposed as answer by Ricky_Brundritt Tuesday, April 4, 2017 6:30 PM
- Marked as answer by Ricky_Brundritt Wednesday, April 5, 2017 5:19 PM
Tuesday, April 4, 2017 6:30 PM
All replies
-
This is a known issue that has been resolved in the experimental branch of Bing Maps V8 and will be rolled into the main release branch around the end of April, beginning of May. You can add &branch=experimental to the map script URL to test this. Alternatively, you can workaround this issue by adding the following check:
var shape = [the polygon from drawing tools]; if (shape instanceof Microsoft.Maps.Polygon && shape.geometry.rings[0].y.length > 0) { shape.geometry.rings[0].y[shape.geometry.rings[0].y.length - 1] = shape.geometry.rings[0].y[0]; //Polygon is now fixed }
- Edited by Ricky_Brundritt Tuesday, April 4, 2017 6:30 PM
- Proposed as answer by Ricky_Brundritt Tuesday, April 4, 2017 6:30 PM
- Marked as answer by Ricky_Brundritt Wednesday, April 5, 2017 5:19 PM
Tuesday, April 4, 2017 6:30 PM -
Ok, thank you.Wednesday, April 5, 2017 8:34 AM