replacing addVectorLayerToMap content

(accidentally deleted in an earlier commit)
solving a problem in which embedded maps were failing to load

MP-205 #comment Fixed