diff --git a/src/map.js b/src/map.js index a9f26ebd..a3feb780 100644 --- a/src/map.js +++ b/src/map.js @@ -802,7 +802,14 @@ jvm.Map.prototype = { getRegionName: function(code){ return this.mapData.paths[code].name; }, - + /** + * Return true if region is in jvectormap. Sometimes some of the regions are not in the base map so this function will return + * false if a region is not in the maps + * @returns {boolean} + */ + checkRegionName: function(code){ + return code in this.mapData.paths; + }, createRegions: function(){ var key, region, @@ -1183,4 +1190,4 @@ jvm.Map.apiEvents = { onMarkerClick: 'markerClick', onMarkerSelected: 'markerSelected', onViewportChange: 'viewportChange' -}; \ No newline at end of file +};