Skip to content

Update Google Maps definitions to latest version #4364

Closed

Description

@cgwrench

The latest release version of the Google Maps JavaScript API is v3.20, and was released on 21 May 2015. The current Google Maps definitions, see googlemaps/google.maps.d.ts, do not match the latest version of the API.

Examples of where the definitions are incorrect include:

  • Definition of LatLngLiteral is missing. This affects numerous methods. We should define export type LatLngLiteral = { lat: number; lng: number };
  • The Data layer API is missing (see Update for Google Maps API 3.16 #2249)
  • MarkerImage is defined, but is no longer part of the API
  • The Marker class getIcon and setIcon methods should return and accept string, Icon or Symbol objects, not string or MarkerImage objects
  • The Marker class has getFlat and getShadow methods which are no longer part of the API
  • The Marker class is missing the methods getAttribution, getOpacity, getPlace (and the corresponding set* methods)
  • The KmlLayer class is missing the methods getZIndex, setUrl and setZIndex.

Note that the above list is not exhaustive.

Activity

  1. vvakame commented on May 19, 2015

    @vvakame
    Member

    @cgwrench thanks your pull request!
    please make additional pull request if you can... 😉

  2. cgwrench commented on May 27, 2015

    @cgwrench
    ContributorAuthor

    @vvakame I have made a start on this. However, this is quite a large library so will take a bit of time for me to update completely.

    The following is a list of all types defined in the latest JavaScript API reference. Those marked as done are the ones which I have updated so far.

    • Map
      • Map
      • MapOptions
      • MapTypeId
    • Controls
      • MapTypeControlOptions
      • MapTypeControlStyle
      • OverviewMapControlOptions
      • PanControlOptions
      • RotateControlOptions
      • ScaleControlOptions
      • ScaleControlStyle
      • StreetViewControlOptions
      • ZoomControlOptions
      • ZoomControlStyle
      • ControlPosition
    • Data
      • Data
      • Data.DataOptions
      • Data.GeoJsonOptions
      • Data.StyleOptions
      • Data.StylingFunction
      • Data.Feature
      • Data.FeatureOptions
      • Data.Geometry
      • Data.Point
      • Data.MultiPoint
      • Data.LineString
      • Data.MultiLineString
      • Data.LinearRing
      • Data.Polygon
      • Data.MultiPolygon
      • Data.GeometryCollection
      • Data.MouseEvent
      • Data.AddFeatureEvent
      • Data.RemoveFeatureEvent
      • Data.SetGeometryEvent
      • Data.SetPropertyEvent
      • Data.RemovePropertyEvent
    • Overlays
      • Marker
      • MarkerOptions
      • Icon
      • MarkerShape
      • Symbol
      • SymbolPath
      • Animation
      • InfoWindow
      • InfoWindowOptions
      • Polyline
      • PolylineOptions
      • IconSequence
      • Polygon
      • PolygonOptions
      • PolyMouseEvent
      • Rectangle
      • RectangleOptions
      • Circle
      • CircleOptions
      • StrokePosition
      • GroundOverlay
      • GroundOverlayOptions
      • OverlayView
      • MapPanes
      • MapCanvasProjection
    • Services
      • Geocoder
      • GeocoderRequest
      • GeocoderComponentRestrictions
      • GeocoderStatus
      • GeocoderResult
      • GeocoderAddressComponent
      • GeocoderGeometry
      • GeocoderLocationType
      • DirectionsRenderer
      • DirectionsRendererOptions
      • DirectionsService
      • DirectionsRequest
      • TravelMode
      • UnitSystem
      • TransitOptions
      • TransitMode
      • TransitRoutePreference
      • TransitFare
      • DirectionsWaypoint
      • DirectionsStatus
      • DirectionsResult
      • DirectionsRoute
      • DirectionsLeg
      • DirectionsStep
      • Distance
      • Duration
      • Time
      • TransitDetails
      • TransitStop
      • TransitLine
      • TransitAgency
      • TransitVehicle
      • VehicleType
      • ElevationService
      • LocationElevationRequest
      • PathElevationRequest
      • ElevationResult
      • ElevationStatus
      • MaxZoomService
      • MaxZoomResult
      • MaxZoomStatus
      • DistanceMatrixService
      • DistanceMatrixRequest
      • DistanceMatrixResponse
      • DistanceMatrixResponseRow
      • DistanceMatrixResponseElement
      • DistanceMatrixStatus
      • DistanceMatrixElementStatus
    • Save to Google Maps
      • Attribution
      • Place
      • SaveWidget
      • SaveWidgetOptions
    • Map Types
      • MapType
      • MapTypeRegistry
      • Projection
      • ImageMapType
      • ImageMapTypeOptions
      • StyledMapType
      • StyledMapTypeOptions
      • MapTypeStyle
      • MapTypeStyleFeatureType
      • MapTypeStyleElementType
      • MapTypeStyler
    • Layers
      • BicyclingLayer
      • FusionTablesLayer
      • FusionTablesLayerOptions
      • FusionTablesQuery
      • FusionTablesStyle
      • FusionTablesHeatmap
      • FusionTablesMarkerOptions
      • FusionTablesPolygonOptions
      • FusionTablesPolylineOptions
      • FusionTablesMouseEvent
      • FusionTablesCell
      • KmlLayer
      • KmlLayerOptions
      • KmlLayerMetadata
      • KmlLayerStatus
      • KmlMouseEvent
      • KmlFeatureData
      • KmlAuthor
      • TrafficLayer
      • TransitLayer
    • Street View
      • StreetViewPanorama
      • StreetViewPanoramaOptions
      • StreetViewAddressControlOptions
      • StreetViewLink
      • StreetViewPov
      • StreetViewPanoramaData
      • StreetViewLocation
      • StreetViewTileData
      • StreetViewService
      • StreetViewStatus
      • StreetViewCoverageLayer
    • Events
      • MapsEventListener
      • event
      • MouseEvent
    • Base
      • LatLng
      • LatLngLiteral
      • LatLngBounds
      • Point
      • Size
    • MVC
      • MVCObject
      • MVCArray
    • Geometry Library
      • encoding
      • spherical
      • poly
    • AdSense Library
      • AdUnit
      • AdUnitOptions
      • AdFormat
    • Panoramio Library
      • PanoramioLayer
      • PanoramioLayerOptions
      • PanoramioFeature
      • PanoramioMouseEvent
    • Places Library
      • Autocomplete
      • AutocompleteOptions
      • AutocompletePrediction
      • PredictionTerm
      • PredictionSubstring
      • AutocompleteService
      • AutocompletionRequest
      • ComponentRestrictions
      • PlaceAspectRating
      • PlaceDetailsRequest
      • PlaceGeometry
      • PlacePhoto
      • PhotoOptions
      • PlaceResult
      • PlaceReview
      • PlaceSearchPagination
      • PlaceSearchRequest
      • PlacesService
      • PlacesServiceStatus
      • QueryAutocompletePrediction
      • QueryAutocompletionRequest
      • RadarSearchRequest
      • RankBy
      • SearchBox
      • SearchBoxOptions
      • TextSearchRequest
    • Drawing Library
      • DrawingManager
      • DrawingManagerOptions
      • DrawingControlOptions
      • OverlayCompleteEvent
      • OverlayType
    • Weather Library
      • CloudLayer
      • WeatherLayer
      • WeatherLayerOptions
      • TemperatureUnit
      • WindSpeedUnit
      • LabelColor
      • WeatherMouseEvent
      • WeatherFeature
      • WeatherConditions
      • WeatherForecast
    • Visualization Library
      • MapsEngineLayer
      • MapsEngineLayerOptions
      • MapsEngineLayerProperties
      • MapsEngineMouseEvent
      • MapsEngineStatus
      • DynamicMapsEngineLayer
      • DynamicMapsEngineLayerOptions
      • DynamicMapsEngineMouseEvent
      • FeatureStyle
      • HeatmapLayer
      • HeatmapLayerOptions
      • WeightedLocation

    Outstanding issues

    • Element is used in the definition in multiple places. The API documentation uses Node. The definitions should be updated to use Node instead of Element.
    • A number of parts of the API reference a typed MVCArray, e.g. MVCArray<LatLng>. Should a generic MVCArray<T> be added to the definitions.
    • A number of parts of the API reference a type of Array<LatLng|LatLngLiteral>. Is this accurately reflected by using LatLng[]|LatLngLiteral[]?
  3. rayshan commented on Jun 16, 2015

    @rayshan

    +1

  4. added a commit that references this issue on Jul 6, 2015
    df6407f
  5. PrashantAshok commented on Jul 13, 2015

    @PrashantAshok

    Hey @cgwrench , it looks like InfoWindow.open() has been incorrectly updated in this pull request, as per 3.20 version it still accepts Map as option.

    open(map?:Map|StreetViewPanorama, anchor?:MVCObject)
    

    Can you please fix it?

  6. added a commit that references this issue on Jul 13, 2015
    3810720
  7. cgwrench commented on Jul 13, 2015

    @cgwrench
    ContributorAuthor

    @PrashantAshok Good spot. I did initialy change this to be a single function definition as part of 3e467db, however, this appears to have been overwritten by a subsequent merge.

    This issue should be fixed by #4913.

  8. PrashantAshok commented on Jul 14, 2015

    @PrashantAshok

    Thanks @cgwrench for the quick fix. I also noticed that all params of GeocoderComponentRestrictions should be optional as per the spec

    export interface GeocoderComponentRestrictions {
            administrativeArea: string;
            country: string;
            locality: string;
            postalCode: string;
            route: string;
    }
    

    btw, let me know if you need any help in updating type def for any remaining items, I can try to pitch in - places library?

  9. added a commit that references this issue on Jul 20, 2015
    a4623db
  10. cgwrench commented on Jul 20, 2015

    @cgwrench
    ContributorAuthor

    @PrashantAshok Thanks for raising this. This issue should be fixed by #4993. I've tried to check all options objects for the correct specification of optional properties, but I may have missed some. Feel free to raise these as new issues if you spot any.

    The entire library should be up to date (with version 3.20 of the Google Maps API). However, the tests are severly lacking. If you would like to contribute some tests that would be really helpful. Feel free to start with a single aspect of the API, such as the Places library.

  11. added a commit that references this issue on Jul 29, 2015
    eea06e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions