[OpenLayers-Users] multiple Markers?????

Prasad Choudhary prasad.choudhary at gmail.com
Thu Aug 30 02:59:40 EDT 2007


Thanks Eric

its working. Thank you man.....!




On 8/30/07, Eric Lemoine <eric.c2c at gmail.com> wrote:
>
> On 8/30/07, Prasad Choudhary <prasad.choudhary at gmail.com> wrote:
> > Hello List,
>
> Hi
>
>
> >
> > I want to render the base map with miltiple markers for that the code i
> put
> > is like
> >
> > <code>
> >
> > putMakers = function(){
> >    var size = new OpenLayers.Size(12,20);
> >    var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
> >    icon = new
> > OpenLayers.Icon('../img/marker_20_blue.png',size,offset);
> >
> >    markerArray = new Array(myData.length);
> >
> >    for(var i=0; i< myData.length; i++)
> >    {
> >     locLonLat = new OpenLayers.LonLat(myData[i][1],myData[i][0]);
> >     markerArray[i] = new OpenLayers.Marker (locLonLat,icon);
> >     markerLayer.addMarker(markerArray[i]);
> >    }
> > }
> >
> > </code>
> >
> > Markers are creating but vanishing and I am able to see only last marker
> > location only
> > can any one tell me why it is so????
> >
> > is there any other better solution for this!!
>
> Try creating a new icon for every new marker. I haven't actually
> checked whether that'd work out, but using one icon for every marker
> seems problematic to me.
>
> --
> Eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070830/52af1b64/attachment.html


More information about the Users mailing list