FrameCloud Popups from json file in OpenLayers 2.13

المشرف العام

Administrator
طاقم الإدارة
So my problem is that i get only the last popup message from my json file.My marker builder works nice.Any thoughts will be helpful guys. Here is my code:

function airports() { pointsmarks = new OpenLayers.Layer.Markers("Airports"); $.getJSON('../json/airports.json', function (data) { $.each(data, function () { px = this.FIELD7; py = this.FIELD8; name=this.FIELD2; size = new OpenLayers.Size(30, 30); offset = new OpenLayers.Pixel(-(size.w / 2), -(size.h / 2)); airicon = new OpenLayers.Icon('../icons/airportsvg.png', size, offset); map.addLayer(pointsmarks); pointsmarks.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(py, px), airicon)); pointsmarks.events.register('mouseover', pointsmarks, function(evt) { popup = new OpenLayers.Popup.FramedCloud("Popup", (new OpenLayers.LonLat(py, px)), null, ''+name+'
', null, false); map.addPopup(popup); pointsmarks.events.register('mouseout', pointsmarks, setTimeout( function(evt) { popup.destroy(); }, 4000)); }); }); }); }

أكثر...
 
أعلى