The map (with red buildings) is realtime converted to png image and sent to the API which returns the outer and inner contour of the red shapes. The API is call when you zoom or scroll. Mouse over the buildings to show the green calculated contours.