def map(self, features=None, query=None, styles=None,<EOL>bbox=[-<NUM_LIT>,-<NUM_LIT>,<NUM_LIT>,<NUM_LIT>], zoom=<NUM_LIT:10>, center=None, <EOL>image=None, image_bounds=None, cmap='<STR_LIT>',<EOL>api_key=os.environ.get('<STR_LIT>', None), **kwargs):
try:<EOL><INDENT>from IPython.display import display<EOL><DEDENT>except:<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT>assert api_key is not None, "<STR_LIT>"<EOL>if features is None and query is not None:<EOL><INDENT>wkt = box(*bbox).wkt<EOL>features = self.query(wkt, query, index=None)<EOL><DEDENT>elif features is None and query is None and image is None:<EOL><INDENT>print('<STR_LIT>')<EOL>return<EOL><DEDENT>if styles is not None and not isinstance(styles, list):<EOL><INDENT>styles = [styles]<EOL><DEDENT>geojson = {"<STR_LIT:type>":"<STR_LIT>", "<STR_LIT>": features}<EOL>if center is None and features is not None:<EOL><INDENT>union = cascaded_union([shape(f['<STR_LIT>']) for f in features])<EOL>lon, lat = union.centroid.coords[<NUM_LIT:0>]<EOL><DEDENT>elif center is None and image is not None:<EOL><INDENT>try:<EOL><INDENT>lon, lat = shape(image).centroid.coords[<NUM_LIT:0>]<EOL><DEDENT>except:<EOL><INDENT>lon, lat = box(*image_bounds).centroid.coords[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>lat, lon = center<EOL><DEDENT>map_id = "<STR_LIT>".format(str(int(time.time())))<EOL>map_data = VectorGeojsonLayer(geojson, styles=styles, **kwargs)<EOL>image_layer = self._build_image_layer(image, image_bounds, cmap)<EOL>template = BaseTemplate(map_id, **{<EOL>"<STR_LIT>": lat, <EOL>"<STR_LIT>": lon, <EOL>"<STR_LIT>": zoom,<EOL>"<STR_LIT>": json.dumps(map_data.datasource),<EOL>"<STR_LIT>": json.dumps(map_data.layers),<EOL>"<STR_LIT>": image_layer,<EOL>"<STR_LIT>": api_key,<EOL>"<STR_LIT>": '<STR_LIT>'<EOL>})<EOL>template.inject()<EOL>
Renders a mapbox gl map from a vector service query or a list of geojson features

Args:
  features (list): a list of geojson features
  query (str): a VectorServices query 
  styles (list): a list of VectorStyles to apply to the features  
  bbox (list): a bounding box to query for features ([minx, miny, maxx, maxy])
  zoom (int): the initial zoom level of the map
  center (list): a list of [lat, lon] used to center the map
  api_key (str): a valid Mapbox API key
  image (dict): a CatalogImage or a ndarray
  image_bounds (list): a list of bounds for image positioning 
  Use outside of GBDX Notebooks requires a MapBox API key, sign up for free at https://www.mapbox.com/pricing/
  Pass the key using the `api_key` keyword or set an environmental variable called `MAPBOX API KEY`
  cmap (str): MatPlotLib colormap to use for rendering single band images (default: viridis)