[OpenLayers-Users] Problem with markers performence

suneel kota suneel.kota at gmail.com
Mon Jan 8 06:53:12 EST 2007


Hi Christopher, Thanks for ur reply..

please check my code which i am using ajax to display the markers..

// getting placemarkers array from the Ajax

function displayMarkers() { for (var i =0; i < placemarkers.length; i++) {

// obtain the attribues of each marker

var lat =
encode(placemarkers[i].getElementsByTagName("latitude")[0].firstChild.nodeValue);

var lng =
encode(placemarkers[i].getElementsByTagName("longitude")[0].firstChild.nodeValue);

// create the marker

createMarker(lat,lng); }

// adding markers layer to the map

map.addLayer(markers);

}

// to create the marker

// declared size and calculateOffset in my program

function createMarker(lati,longi) {

var markerplace = new OpenLayers.LonLat(longi,lati);

var icon = new OpenLayers.Icon(url, size, null, calculateOffset);

marker = new OpenLayers.Marker(markerplace, icon);

marker.events.register('click', marker, function frmAddNe(evt) {

// this is the method to call again ajax request to display particular
marker data

callFunction(longi,lati);

Event.stop(evt); });

// adding marker  to the markers layer

markers.addMarker(marker);

}



Please assist me as soon as possible.. It will be very helpful for me if you
can..



Thanks &Regards

SuneelKota


On 1/6/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
>
> On Sat, Jan 06, 2007 at 01:22:24AM -0500, suneel kota wrote:
> > Hi all,
> >
> >      I am using openlayers markers to display markers in my map..
> Problem
> > is that when i am loading 1000markers on the map its taking more time(2
> > minutes).
> > I am placing the markers with Latitude and Longitude which are coming
> from
> > database..
> >
> >    What my requirement i need to place 1000 markers on the map, and when
> > ever user clicks on the marker i need show the information of that
> > particular marker. But we have placed all markers and given events to
> those
> > markers as click. But we are facing performance issue..
> >
> > Can anybody tell me how to rectify this problem. Or any example like
> this..
>
>
> Which browser are you using?
>
> If you are using IE6, this is basically expected behavior with no known
> solution. Because IE doesn't truly support alpha transparency in images,
> adding 1000 of these images to a map takes a long time, and OpenLayers
> has no ability to do anything about it.
>
> If you are willing to keep your usage limited to other browsers, the
> level of performance you are seeing seems different than what I would
> expect. The GeoSearch client released by MetaCarta uses a large number
> of markers successfully in Firefox/Safari/Opera (Although I'll admit
> that Safari and Opera are definitely slower).
>
> IE7 is slow, but not to the same extent as IE6 -- you might want to try
> that if you think that you need to support IE.
>
> If you're seeing poor performance in something other than IE6, could you
> please provide a simple example of HTML or a URL which reproduces the
> problem?
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070108/9711df26/attachment.html


More information about the Users mailing list