ok so below is my general concept of applicationwhen application is started, user can pick the region to show points on the map. He picks something, then by AJAX my script is connecting to database which is returning X,Y coordinates for points, then I create json contains those coordinates and by addGraphics() points are on the map. Now, in event onPanStart I've got sequence:
MAP.map.onPanStart = function() {
MAP.map.disableMapNavigation();
};
and onPanEnd:
MAP.map.onPanEnd = function(extent, endPoint) {
if(checkIfExtentContainsBoreholes()){
if (MAP.points.length > 0) {
MAP.drawPoints();
}
};
};
and first if statement (checkIfExtentContainsBoreholes) checks if database contains points from my extent, and if its true, then it put points by the same function as is before (coordinates to json..)so when onPanEnd drawing event has started I can pan map again, and if the graphics still are not on the map and I pan map to other place they appears badly(because the SVG graphic is drawing by relative coordinates to top-left corner of the map)