diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 185c40a825..c48a72cb04 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -7,7 +7,8 @@ OpenLayers.Icon.prototype = { // {OpenLayers.Size}: size of image size:null, - initialize: function() { - + initialize: function(url, size) { + this.size = size; + this.url = url; } } diff --git a/lib/OpenLayers/Marker.js b/lib/OpenLayers/Marker.js index 5ff7d166d4..fbd4c75a5d 100644 --- a/lib/OpenLayers/Marker.js +++ b/lib/OpenLayers/Marker.js @@ -6,8 +6,35 @@ OpenLayers.Marker.prototype = { // latlon: {OpenLayers.LatLon} location of object latlon: null, + + // events + events: null, + + // map + map: null, + + initialize: function(icon, latlon) { + this.icon = icon; + this.latlon = latlon; + }, - initialize: function() { - - } + draw: function() { + var resolution = this.map.getResolution(); + var extent = this.map.getExtent(); + if (this.latlon.lat > extent.minlat && + this.latlon.lat < extent.maxlat && + this.lonlon.lon > extent.minlon && + this.lonlon.lon < extent.maxlon) { + var pixel = new OpenLayers.Pixel( + resolution * (this.latlon.lon - extent.minlon), + resolution * (extent.maxlat - this.latlon.lat) + ); + // need to account for how much layer has moved... + /* Psuedocode: + div = map.markersDiv; + marker = OpenLayers.Util.createDiv('marker'+rand(), pixel, this.icon.size, null, this.icon.url); + div.appendChild(marker); + */ + } + } } diff --git a/tests/list-tests.html b/tests/list-tests.html index cb0882209b..e828a5fa0a 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -1,6 +1,8 @@