Interface IOwlMap

All Superinterfaces:
ICefObjRef
All Known Subinterfaces:
IOwlMapWrapped

public interface IOwlMap
extends ICefObjRef
Represents a displayed map. Corresponds to Google Map Javascript API google.maps.Map
Author:
swong
  • Method Summary

    Modifier and Type Method Description
    void addGeoJson​(java.lang.String geoJsonStr, java.util.function.Consumer<java.util.Map<java.lang.String,​IMapDataFeature>> callback)
    Load GeoJSON data into the map from the given JSON string.
    ILatLng getCenter()
    Get the ILatLng of the center of the map
    MapTypeId getMapTypeId()
    Get the type of Map being displayed.
    int getZoom()
    Get the current zoom level
    void goTo​(IPlace place)
    Pan the center of the map to the location and set the zoom level to that specified by the given IPlace
    void loadGeoJson​(java.lang.String url, java.util.function.Consumer<java.util.Map<java.lang.String,​IMapDataFeature>> callback)
    Load GeoJSON data into the map from the given URL.
    void overrideDataStyleById​(java.lang.String featureId, provided.mixedData.IMixedDataDictionary mapDataStyleOptions)
    Override the styling of a feature with the given options
    void panTo​(ILatLng latLng)
    Pan the map to the given location.
    void revertDataStyleAll()
    Revert the styling of all features back to the default styling.
    void revertDataStyleById​(java.lang.String featureId)
    Revert the styling of a feature back to the default styling
    void setCenter​(ILatLng latLng)
    Set the ILatLng of the center of the map
    void setDataStyle​(provided.mixedData.IMixedDataDictionary mapDataStyleOptions)
    Set the default appearance styling for the maps displayed data
    void setMapEvent​(MapEventType eventType, java.lang.Runnable eventFn)
    Set the given MapEventType event to run the given event handler function
    void setMapMouseDragEvent​(MapMouseDragEventType eventType, java.lang.Runnable eventFn)
    Set the given MapMouseDragEventType event to invoke the given event handler function
    void setMapMouseEvent​(MapMouseEventType eventType, java.util.function.Consumer<IMouseEvent> eventFn)
    Set the given MapMouseEventType event to invoke the given event handler function
    void setMapTypeId​(MapTypeId mapTypeID)
    Sets the displayed map type.
    void setOptions​(provided.mixedData.IMixedDataDictionary options)
    Set the map to the given IMapOptions options in the given dictionary
    void setZoom​(int zoom)
    Set the current zoom level

    Methods inherited from interface provided.owlMaps.cefUtils.ICefObjRef

    getCefId
  • Method Details

    • getCenter

      ILatLng getCenter()
      Get the ILatLng of the center of the map
      Returns:
      An ILatLng object
    • setCenter

      void setCenter​(ILatLng latLng)
      Set the ILatLng of the center of the map
      Parameters:
      latLng - An ILatLng object
    • getMapTypeId

      MapTypeId getMapTypeId()
      Get the type of Map being displayed. See MapTypeId for valid values
      Returns:
      The map type
    • setMapTypeId

      void setMapTypeId​(MapTypeId mapTypeID)
      Sets the displayed map type. See MapTypeId for the valid values
      Parameters:
      mapTypeID - The type of map to display
    • getZoom

      int getZoom()
      Get the current zoom level
      Returns:
      The current zoom level
    • setZoom

      void setZoom​(int zoom)
      Set the current zoom level
      Parameters:
      zoom - The new zoom level
    • goTo

      void goTo​(IPlace place)
      Pan the center of the map to the location and set the zoom level to that specified by the given IPlace
      Parameters:
      place - The IPlace to move the map to.
    • panTo

      void panTo​(ILatLng latLng)
      Pan the map to the given location. The zoom level is unchanged.
      Parameters:
      latLng - The new location
    • setOptions

      void setOptions​(provided.mixedData.IMixedDataDictionary options) throws java.lang.ClassNotFoundException
      Set the map to the given IMapOptions options in the given dictionary
      Parameters:
      options - A dictionary containing IMapOptions option key-values.
      Throws:
      java.lang.ClassNotFoundException - If a aupplied IMapOptions option is unknown
    • setMapEvent

      void setMapEvent​(MapEventType eventType, java.lang.Runnable eventFn)
      Set the given MapEventType event to run the given event handler function
      Parameters:
      eventType - The desired MapEventType
      eventFn - The handler function to run when the given event type occurs.
    • setMapMouseEvent

      void setMapMouseEvent​(MapMouseEventType eventType, java.util.function.Consumer<IMouseEvent> eventFn)
      Set the given MapMouseEventType event to invoke the given event handler function
      Parameters:
      eventType - The desired event type
      eventFn - The event handler function to invoke when the event occurs.
    • setMapMouseDragEvent

      void setMapMouseDragEvent​(MapMouseDragEventType eventType, java.lang.Runnable eventFn)
      Set the given MapMouseDragEventType event to invoke the given event handler function
      Parameters:
      eventType - The desired event type
      eventFn - The event handler function to invoke when the event occurs.
    • loadGeoJson

      void loadGeoJson​(java.lang.String url, java.util.function.Consumer<java.util.Map<java.lang.String,​IMapDataFeature>> callback)
      Load GeoJSON data into the map from the given URL. If a feature is not defined in the GeoJSON data with an "id" field, the feature ID will be returned as "undefined_X" where X = [0, 1, ...]. Since this operation can take a considerable amount of time to execute, a Consumer function needs to be provided that will run asynchronously when the results are ready. The IMapDataFeatures created by the GeoJSON data, mapped to their respective IDs, is supplied to the callback function. WARNING: Do not manipulate the map or map components in the callback due to potential deadlocking problems in the underlying Java-to-Javascript system.
      Parameters:
      url - The url of a GeoJSON file
      callback - The function that is called once the GeoJSON file is loaded and ready. Accepts a mapping of feature IDs to their respective features.
    • addGeoJson

      void addGeoJson​(java.lang.String geoJsonStr, java.util.function.Consumer<java.util.Map<java.lang.String,​IMapDataFeature>> callback)
      Load GeoJSON data into the map from the given JSON string. If a feature is not defined in the GeoJSON data with an "id" field, the feature ID will be returned as "undefined_X" where X = [0, 1, ...]. Since this operation can take a considerable amount of time to execute, a Consumer function needs to be provided that will run asynchronously when the results are ready. The IMapDataFeatures created by the GeoJSON data, mapped to their respective IDs, is supplied to the callback function.
      Parameters:
      geoJsonStr - A GeoJSON encoded JSON string
      callback - The function that is called once the GeoJSON data is loaded and ready. Accepts a mapping of feature IDs to their respective features.
    • setDataStyle

      void setDataStyle​(provided.mixedData.IMixedDataDictionary mapDataStyleOptions)
      Set the default appearance styling for the maps displayed data
      Parameters:
      mapDataStyleOptions - An IMixedDataDictionary containing IMapDataStyleOption key-values
    • overrideDataStyleById

      void overrideDataStyleById​(java.lang.String featureId, provided.mixedData.IMixedDataDictionary mapDataStyleOptions)
      Override the styling of a feature with the given options
      Parameters:
      featureId - The desired feature
      mapDataStyleOptions - An IMixedDataDictionary containing IMapDataStyleOption key-values
    • revertDataStyleById

      void revertDataStyleById​(java.lang.String featureId)
      Revert the styling of a feature back to the default styling
      Parameters:
      featureId - The ID of the desired feature
    • revertDataStyleAll

      void revertDataStyleAll()
      Revert the styling of all features back to the default styling.