Going back to our click event handler, after we show a loading message, we fetch the data through AJAX. Upon success, we show the results on the map.
_showResult: function (result) { this._showPin(result.Info); this._showShape(result.Shape); }
In the previous listing, we first show the information on the pushpin:
_showPin: function (text) { this._pushpin.setOptions({ htmlContent: this._pushpinContent(text) }); }
_showShape: function (shapeString) { this._shapesLayer.clear(); var parts = shapeString.split(','), length = parts.length, i = 0, locations = []; for (; i < length; i++) { var coordinates = parts[i].split(' '); locations.push(new Microsoft.Maps.Location(coordinates[0], coordinates[1])); } var shape = new Microsoft.Maps.Polygon(locations, { strokeColor: new Microsoft.Maps.Color(200, 240, 76, 64), strokeThickness: 2, fillColor: new Microsoft...