directives.api pattern ported to map and polyline to eliminate duplicate
code which has been put into GmapUtil