In IE6 and IE7 but not Firefox I continue to get the error "Unkown Runtime Error" Line 1690 or 1689. I have been able to some what narrow it down to a problem somewhere along creating and adding a polygon (VEShape) to the map. I am using the most resent VE SDK V5 if that helps.

I have tried to narrow it down further but IE is seeming not to follow my Try/Catchs.


Re: "Unkown Runtime Error" Line 1690/1689

Derek Chan

Can you please post some sample code to duplicate the problem your having

Re: "Unkown Runtime Error" Line 1690/1689


Code Snippet

var points = new Array();
points.push(SalesPlotter.LatLong(findArguments[0].LatLongRect.TopLeftLatLong.Latitude, findArguments[0].LatLongRect.TopLeftLatLong.Longitude, this.options.mapType));

points.push(SalesPlotter.LatLong(findArguments[0].LatLongRect.TopLeftLatLong.Latitude, findArguments[0].LatLongRect.BottomRightLatLong.Longitude, this.options.mapType));

points.push(SalesPlotter.LatLong(findArguments[0].LatLongRect.BottomRightLatLong.Latitude, findArguments[0].LatLongRect.BottomRightLatLong.Longitude, this.options.mapType));

points.push(SalesPlotter.LatLong(findArguments[0].LatLongRect.BottomRightLatLong.Latitude, findArguments[0].LatLongRect.TopLeftLatLong.Longitude, this.options.mapType));

var lineColor = SalesPlotter.Color(255, 255, 255, 1.0,this.options.mapType);
var fillColor = SalesPlotter.Color(100, 200, 200, 0.2,this.options.mapType);

var icon = '<div class="PolygonIcon"><a href="#" onclick="map.addZipCode('+ this.polygons.length +'); return false;">'+ zipcode + '</a></div>';
var polygon = this.interface.createPolygon(points, lineColor, fillColor, 2, zipcode, icon);



This is everything that goes with the creation of the polygon. SalesPlotter.LatLong() is the same as calling VELatLong(). The same goes for SalesPlotter.Color() being VEColor();

Re: "Unkown Runtime Error" Line 1690/1689


I have found the problem. It appears the VEShape.SetCustomIcon does not take <a> tags. This becomes a probelm for me becuase I need to have an OnClick event for the icon. Any ideas about how to preform this. I have tried an onClick event on the <div> tag but it seems to not be working.

Re: "Unkown Runtime Error" Line 1690/1689


try using the event handlers built into V5. Look at the iSDK:

section: Use events and callbacks -> Attaching shape events

Code Snippet

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src=" v=5"></script>
var map = null;

function ShapeHandler(e)
if (e.elementID != null)
document.getElementById('resultDiv').innerHTML = e.eventName + " event occurred on shape (id=" + e.elementID + ").";
document.getElementById('resultDiv').innerHTML = e.eventName + " event occurred on map.";

function GetMap()
map = new VEMap('myMap');


function AddPolygon()
var ll = map.GetCenter();
var lat = ll.Latitude;
var lon = ll.Longitude;

var shape = new VEShape(VEShapeType.Polygon, [new VELatLong(lat,lon-0.15),
new VELatLong(lat+0.1,lon-0.05),
new VELatLong(lat+0.1,lon+0.05),
new VELatLong(lat,lon+0.15),
new VELatLong(lat-0.1,lon+0.05),
new VELatLong(lat-0.1,lon-0.05)]);
shape.SetTitle('My polygon');
shape.SetDescription('This is a shape.');
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<div id='resultDiv' style="position:relative; width:400px;">Move the mouse over the polygon to see the event.</div>