@mapgis/mapbox-gl 16.0.1 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mapbox-gl.js +3 -3
- package/dist/mapbox-gl.js.map +1 -1
- package/package.json +1 -1
- package/.flowconfig +0 -61
- package/LICENSE.txt +0 -84
- package/README.md +0 -34
- package/build/banner.js +0 -4
- package/build/check-bundle-size.js +0 -140
- package/build/generate-access-token-script.js +0 -11
- package/build/generate-flow-typed-style-spec.js +0 -188
- package/build/generate-release-list.js +0 -21
- package/build/generate-struct-arrays.js +0 -237
- package/build/generate-style-code.js +0 -159
- package/build/mapbox-gl.js.flow +0 -3
- package/build/print-release-url.js +0 -6
- package/build/rollup_plugin_minify_style_spec.js +0 -20
- package/build/rollup_plugins.js +0 -80
- package/build/run-node +0 -3
- package/build/run-tap +0 -8
- package/build/test/build-tape.js +0 -19
- package/flow-typed/gl.js +0 -5
- package/flow-typed/jsdom.js +0 -18
- package/flow-typed/mapbox-gl-supported.js +0 -9
- package/flow-typed/mapbox-unitbezier.js +0 -14
- package/flow-typed/offscreen-canvas.js +0 -9
- package/flow-typed/pbf.js +0 -25
- package/flow-typed/point-geometry.js +0 -44
- package/flow-typed/potpack.js +0 -12
- package/flow-typed/sinon.js +0 -28
- package/flow-typed/vector-tile.js +0 -41
- package/src/css/mapbox-gl.css +0 -798
- package/src/css/svg/mapboxgl-ctrl-attrib.svg +0 -3
- package/src/css/svg/mapboxgl-ctrl-compass.svg +0 -4
- package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +0 -3
- package/src/css/svg/mapboxgl-ctrl-geolocate.svg +0 -5
- package/src/css/svg/mapboxgl-ctrl-logo.svg +0 -20
- package/src/css/svg/mapboxgl-ctrl-shrink.svg +0 -3
- package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +0 -3
- package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +0 -3
- package/src/data/array_types.js +0 -1095
- package/src/data/bucket/circle_attributes.js +0 -9
- package/src/data/bucket/circle_bucket.js +0 -204
- package/src/data/bucket/fill_attributes.js +0 -9
- package/src/data/bucket/fill_bucket.js +0 -233
- package/src/data/bucket/fill_extrusion_attributes.js +0 -10
- package/src/data/bucket/fill_extrusion_bucket.js +0 -289
- package/src/data/bucket/heatmap_bucket.js +0 -17
- package/src/data/bucket/line_attributes.js +0 -10
- package/src/data/bucket/line_bucket.js +0 -556
- package/src/data/bucket/pattern_attributes.js +0 -10
- package/src/data/bucket/pattern_bucket_features.js +0 -60
- package/src/data/bucket/symbol_attributes.js +0 -117
- package/src/data/bucket/symbol_bucket.js +0 -972
- package/src/data/bucket.js +0 -123
- package/src/data/dem_data.js +0 -125
- package/src/data/extent.js +0 -18
- package/src/data/feature_index.js +0 -321
- package/src/data/feature_position_map.js +0 -125
- package/src/data/index_array_type.js +0 -16
- package/src/data/load_geometry.js +0 -48
- package/src/data/pos_attributes.js +0 -6
- package/src/data/program_configuration.js +0 -687
- package/src/data/raster_bounds_attributes.js +0 -7
- package/src/data/segment.js +0 -76
- package/src/geo/edge_insets.js +0 -102
- package/src/geo/lng_lat.js +0 -165
- package/src/geo/lng_lat_bounds.js +0 -267
- package/src/geo/mercator_coordinate.js +0 -153
- package/src/geo/transform.js +0 -864
- package/src/gl/color_mode.js +0 -34
- package/src/gl/context.js +0 -298
- package/src/gl/cull_face_mode.js +0 -26
- package/src/gl/depth_mode.js +0 -29
- package/src/gl/framebuffer.js +0 -44
- package/src/gl/index_buffer.js +0 -55
- package/src/gl/stencil_mode.js +0 -30
- package/src/gl/types.js +0 -84
- package/src/gl/value.js +0 -520
- package/src/gl/vertex_buffer.js +0 -119
- package/src/index.js +0 -201
- package/src/render/draw_background.js +0 -57
- package/src/render/draw_circle.js +0 -113
- package/src/render/draw_collision_debug.js +0 -49
- package/src/render/draw_custom.js +0 -49
- package/src/render/draw_debug.js +0 -127
- package/src/render/draw_fill.js +0 -126
- package/src/render/draw_fill_extrusion.js +0 -96
- package/src/render/draw_heatmap.js +0 -140
- package/src/render/draw_hillshade.js +0 -108
- package/src/render/draw_line.js +0 -98
- package/src/render/draw_raster.js +0 -125
- package/src/render/draw_symbol.js +0 -394
- package/src/render/glyph_atlas.js +0 -71
- package/src/render/glyph_manager.js +0 -182
- package/src/render/image_atlas.js +0 -149
- package/src/render/image_manager.js +0 -306
- package/src/render/line_atlas.js +0 -210
- package/src/render/painter.js +0 -653
- package/src/render/program/background_program.js +0 -103
- package/src/render/program/circle_program.js +0 -69
- package/src/render/program/clipping_mask_program.js +0 -20
- package/src/render/program/collision_program.js +0 -49
- package/src/render/program/debug_program.js +0 -35
- package/src/render/program/fill_extrusion_program.js +0 -122
- package/src/render/program/fill_program.js +0 -126
- package/src/render/program/heatmap_program.js +0 -83
- package/src/render/program/hillshade_program.js +0 -122
- package/src/render/program/line_program.js +0 -207
- package/src/render/program/pattern.js +0 -102
- package/src/render/program/program_uniforms.js +0 -42
- package/src/render/program/raster_program.js +0 -92
- package/src/render/program/symbol_program.js +0 -224
- package/src/render/program.js +0 -168
- package/src/render/texture.js +0 -122
- package/src/render/uniform_binding.js +0 -147
- package/src/render/vertex_array_object.js +0 -163
- package/src/shaders/README.md +0 -42
- package/src/shaders/_prelude.fragment.glsl +0 -17
- package/src/shaders/_prelude.vertex.glsl +0 -73
- package/src/shaders/background.fragment.glsl +0 -10
- package/src/shaders/background.vertex.glsl +0 -7
- package/src/shaders/background_pattern.fragment.glsl +0 -28
- package/src/shaders/background_pattern.vertex.glsl +0 -20
- package/src/shaders/circle.fragment.glsl +0 -39
- package/src/shaders/circle.vertex.glsl +0 -64
- package/src/shaders/clipping_mask.fragment.glsl +0 -3
- package/src/shaders/clipping_mask.vertex.glsl +0 -7
- package/src/shaders/collision_box.fragment.glsl +0 -21
- package/src/shaders/collision_box.vertex.glsl +0 -27
- package/src/shaders/collision_circle.fragment.glsl +0 -34
- package/src/shaders/collision_circle.vertex.glsl +0 -36
- package/src/shaders/debug.fragment.glsl +0 -9
- package/src/shaders/debug.vertex.glsl +0 -12
- package/src/shaders/encode_attribute.js +0 -17
- package/src/shaders/fill.fragment.glsl +0 -13
- package/src/shaders/fill.vertex.glsl +0 -13
- package/src/shaders/fill_extrusion.fragment.glsl +0 -9
- package/src/shaders/fill_extrusion.vertex.glsl +0 -66
- package/src/shaders/fill_extrusion_pattern.fragment.glsl +0 -45
- package/src/shaders/fill_extrusion_pattern.vertex.glsl +0 -79
- package/src/shaders/fill_outline.fragment.glsl +0 -17
- package/src/shaders/fill_outline.vertex.glsl +0 -17
- package/src/shaders/fill_outline_pattern.fragment.glsl +0 -43
- package/src/shaders/fill_outline_pattern.vertex.glsl +0 -44
- package/src/shaders/fill_pattern.fragment.glsl +0 -36
- package/src/shaders/fill_pattern.vertex.glsl +0 -39
- package/src/shaders/heatmap.fragment.glsl +0 -22
- package/src/shaders/heatmap.vertex.glsl +0 -54
- package/src/shaders/heatmap_texture.fragment.glsl +0 -14
- package/src/shaders/heatmap_texture.vertex.glsl +0 -11
- package/src/shaders/hillshade.fragment.glsl +0 -52
- package/src/shaders/hillshade.vertex.glsl +0 -11
- package/src/shaders/hillshade_prepare.fragment.glsl +0 -74
- package/src/shaders/hillshade_prepare.vertex.glsl +0 -15
- package/src/shaders/index.js +0 -20
- package/src/shaders/line.fragment.glsl +0 -30
- package/src/shaders/line.vertex.glsl +0 -85
- package/src/shaders/line_gradient.fragment.glsl +0 -34
- package/src/shaders/line_gradient.vertex.glsl +0 -87
- package/src/shaders/line_pattern.fragment.glsl +0 -74
- package/src/shaders/line_pattern.vertex.glsl +0 -99
- package/src/shaders/line_sdf.fragment.glsl +0 -45
- package/src/shaders/line_sdf.vertex.glsl +0 -98
- package/src/shaders/raster.fragment.glsl +0 -52
- package/src/shaders/raster.vertex.glsl +0 -21
- package/src/shaders/shaders.js +0 -180
- package/src/shaders/symbol_icon.fragment.glsl +0 -17
- package/src/shaders/symbol_icon.vertex.glsl +0 -94
- package/src/shaders/symbol_sdf.fragment.glsl +0 -52
- package/src/shaders/symbol_sdf.vertex.glsl +0 -115
- package/src/shaders/symbol_text_and_icon.fragment.glsl +0 -68
- package/src/shaders/symbol_text_and_icon.vertex.glsl +0 -116
- package/src/source/canvas_source.js +0 -238
- package/src/source/geojson_helper.js +0 -92
- package/src/source/geojson_source.js +0 -374
- package/src/source/geojson_worker_source.js +0 -357
- package/src/source/geojson_wrapper.js +0 -94
- package/src/source/image_source.js +0 -307
- package/src/source/load_tilejson.js +0 -39
- package/src/source/mbtiles_source.js +0 -115
- package/src/source/offline_database.js +0 -61
- package/src/source/offline_database_root.js +0 -62
- package/src/source/pixels_to_tile_units.js +0 -21
- package/src/source/query_features.js +0 -208
- package/src/source/raster_dem_tile_source.js +0 -138
- package/src/source/raster_dem_tile_worker_source.js +0 -62
- package/src/source/raster_tile_offline_source.js +0 -136
- package/src/source/raster_tile_source.js +0 -177
- package/src/source/rtl_text_plugin.js +0 -138
- package/src/source/source.js +0 -137
- package/src/source/source_cache.js +0 -957
- package/src/source/source_state.js +0 -159
- package/src/source/tile.js +0 -465
- package/src/source/tile_bounds.js +0 -38
- package/src/source/tile_cache.js +0 -212
- package/src/source/tile_id.js +0 -402
- package/src/source/vector_tile_source.js +0 -192
- package/src/source/vector_tile_worker_source.js +0 -216
- package/src/source/video_source.js +0 -203
- package/src/source/worker.js +0 -237
- package/src/source/worker_source.js +0 -106
- package/src/source/worker_tile.js +0 -224
- package/src/style/create_style_layer.js +0 -36
- package/src/style/evaluation_parameters.js +0 -62
- package/src/style/light.js +0 -130
- package/src/style/load_glyph_range.js +0 -38
- package/src/style/load_sprite.js +0 -67
- package/src/style/parse_glyph_pbf.js +0 -44
- package/src/style/pauseable_placement.js +0 -132
- package/src/style/properties.js +0 -753
- package/src/style/query_utils.js +0 -43
- package/src/style/style.js +0 -1361
- package/src/style/style_glyph.js +0 -17
- package/src/style/style_image.js +0 -137
- package/src/style/style_layer/background_style_layer.js +0 -21
- package/src/style/style_layer/background_style_layer_properties.js +0 -40
- package/src/style/style_layer/circle_style_layer.js +0 -98
- package/src/style/style_layer/circle_style_layer_properties.js +0 -63
- package/src/style/style_layer/custom_style_layer.js +0 -223
- package/src/style/style_layer/fill_extrusion_style_layer.js +0 -224
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +0 -50
- package/src/style/style_layer/fill_style_layer.js +0 -67
- package/src/style/style_layer/fill_style_layer_properties.js +0 -55
- package/src/style/style_layer/heatmap_style_layer.js +0 -69
- package/src/style/style_layer/heatmap_style_layer_properties.js +0 -44
- package/src/style/style_layer/hillshade_style_layer.js +0 -25
- package/src/style/style_layer/hillshade_style_layer_properties.js +0 -46
- package/src/style/style_layer/layer_properties.js.ejs +0 -69
- package/src/style/style_layer/line_style_layer.js +0 -151
- package/src/style/style_layer/line_style_layer_properties.js +0 -71
- package/src/style/style_layer/raster_style_layer.js +0 -21
- package/src/style/style_layer/raster_style_layer_properties.js +0 -50
- package/src/style/style_layer/symbol_style_layer.js +0 -190
- package/src/style/style_layer/symbol_style_layer_properties.js +0 -153
- package/src/style/style_layer/typed_style_layer.js +0 -17
- package/src/style/style_layer.js +0 -281
- package/src/style/style_layer_index.js +0 -80
- package/src/style/validate_style.js +0 -42
- package/src/style/zoom_history.js +0 -44
- package/src/style-spec/.eslintrc +0 -5
- package/src/style-spec/CHANGELOG.md +0 -438
- package/src/style-spec/README.md +0 -59
- package/src/style-spec/bin/gl-style-composite +0 -9
- package/src/style-spec/bin/gl-style-format +0 -22
- package/src/style-spec/bin/gl-style-migrate +0 -9
- package/src/style-spec/bin/gl-style-validate +0 -50
- package/src/style-spec/composite.js +0 -50
- package/src/style-spec/declass.js +0 -42
- package/src/style-spec/deref.js +0 -52
- package/src/style-spec/diff.js +0 -393
- package/src/style-spec/dist/.gitkeep +0 -0
- package/src/style-spec/empty.js +0 -29
- package/src/style-spec/error/parsing_error.js +0 -16
- package/src/style-spec/error/validation_error.js +0 -18
- package/src/style-spec/expression/compound_expression.js +0 -162
- package/src/style-spec/expression/definitions/assertion.js +0 -130
- package/src/style-spec/expression/definitions/at.js +0 -70
- package/src/style-spec/expression/definitions/case.js +0 -85
- package/src/style-spec/expression/definitions/coalesce.js +0 -93
- package/src/style-spec/expression/definitions/coercion.js +0 -133
- package/src/style-spec/expression/definitions/collator.js +0 -78
- package/src/style-spec/expression/definitions/comparison.js +0 -184
- package/src/style-spec/expression/definitions/format.js +0 -144
- package/src/style-spec/expression/definitions/format_section_override.js +0 -54
- package/src/style-spec/expression/definitions/image.js +0 -52
- package/src/style-spec/expression/definitions/in.js +0 -92
- package/src/style-spec/expression/definitions/index.js +0 -561
- package/src/style-spec/expression/definitions/interpolate.js +0 -267
- package/src/style-spec/expression/definitions/length.js +0 -61
- package/src/style-spec/expression/definitions/let.js +0 -72
- package/src/style-spec/expression/definitions/literal.js +0 -77
- package/src/style-spec/expression/definitions/match.js +0 -158
- package/src/style-spec/expression/definitions/number_format.js +0 -142
- package/src/style-spec/expression/definitions/step.js +0 -120
- package/src/style-spec/expression/definitions/var.js +0 -46
- package/src/style-spec/expression/definitions/within.js +0 -333
- package/src/style-spec/expression/evaluation_context.js +0 -59
- package/src/style-spec/expression/expression.js +0 -27
- package/src/style-spec/expression/index.js +0 -392
- package/src/style-spec/expression/is_constant.js +0 -59
- package/src/style-spec/expression/parsing_context.js +0 -233
- package/src/style-spec/expression/parsing_error.js +0 -13
- package/src/style-spec/expression/runtime_error.js +0 -17
- package/src/style-spec/expression/scope.js +0 -36
- package/src/style-spec/expression/stops.js +0 -39
- package/src/style-spec/expression/types/collator.js +0 -61
- package/src/style-spec/expression/types/formatted.js +0 -73
- package/src/style-spec/expression/types/resolved_image.js +0 -29
- package/src/style-spec/expression/types.js +0 -106
- package/src/style-spec/expression/values.js +0 -123
- package/src/style-spec/feature_filter/README.md +0 -55
- package/src/style-spec/feature_filter/convert.js +0 -208
- package/src/style-spec/feature_filter/index.js +0 -165
- package/src/style-spec/format.js +0 -51
- package/src/style-spec/function/convert.js +0 -254
- package/src/style-spec/function/index.js +0 -262
- package/src/style-spec/group_by_layout.js +0 -75
- package/src/style-spec/migrate/expressions.js +0 -39
- package/src/style-spec/migrate/v8.js +0 -203
- package/src/style-spec/migrate/v9.js +0 -26
- package/src/style-spec/migrate.js +0 -36
- package/src/style-spec/package.json +0 -41
- package/src/style-spec/read_style.js +0 -14
- package/src/style-spec/reference/latest.js +0 -3
- package/src/style-spec/reference/v8.json +0 -5808
- package/src/style-spec/rollup.config.js +0 -45
- package/src/style-spec/style-spec.js +0 -122
- package/src/style-spec/types.js +0 -438
- package/src/style-spec/util/color.js +0 -95
- package/src/style-spec/util/color_spaces.js +0 -139
- package/src/style-spec/util/deep_equal.js +0 -28
- package/src/style-spec/util/extend.js +0 -10
- package/src/style-spec/util/get_type.js +0 -17
- package/src/style-spec/util/interpolate.js +0 -22
- package/src/style-spec/util/properties.js +0 -15
- package/src/style-spec/util/ref_properties.js +0 -2
- package/src/style-spec/util/result.js +0 -19
- package/src/style-spec/util/unbundle_jsonlint.js +0 -24
- package/src/style-spec/validate/latest.js +0 -11
- package/src/style-spec/validate/validate.js +0 -75
- package/src/style-spec/validate/validate_array.js +0 -52
- package/src/style-spec/validate/validate_boolean.js +0 -15
- package/src/style-spec/validate/validate_color.js +0 -20
- package/src/style-spec/validate/validate_constants.js +0 -13
- package/src/style-spec/validate/validate_enum.js +0 -21
- package/src/style-spec/validate/validate_expression.js +0 -43
- package/src/style-spec/validate/validate_filter.js +0 -111
- package/src/style-spec/validate/validate_formatted.js +0 -11
- package/src/style-spec/validate/validate_function.js +0 -207
- package/src/style-spec/validate/validate_glyphs_url.js +0 -21
- package/src/style-spec/validate/validate_image.js +0 -11
- package/src/style-spec/validate/validate_layer.js +0 -134
- package/src/style-spec/validate/validate_layout_property.js +0 -6
- package/src/style-spec/validate/validate_light.js +0 -47
- package/src/style-spec/validate/validate_number.js +0 -29
- package/src/style-spec/validate/validate_object.js +0 -61
- package/src/style-spec/validate/validate_paint_property.js +0 -6
- package/src/style-spec/validate/validate_property.js +0 -64
- package/src/style-spec/validate/validate_source.js +0 -111
- package/src/style-spec/validate/validate_string.js +0 -15
- package/src/style-spec/validate_mapbox_api_supported.js +0 -171
- package/src/style-spec/validate_style.js +0 -39
- package/src/style-spec/validate_style.min.js +0 -78
- package/src/style-spec/visit.js +0 -77
- package/src/symbol/anchor.js +0 -26
- package/src/symbol/check_max_angle.js +0 -81
- package/src/symbol/clip_line.js +0 -71
- package/src/symbol/collision_feature.js +0 -217
- package/src/symbol/collision_index.js +0 -372
- package/src/symbol/cross_tile_symbol_index.js +0 -301
- package/src/symbol/get_anchors.js +0 -167
- package/src/symbol/grid_index.js +0 -335
- package/src/symbol/mergelines.js +0 -82
- package/src/symbol/one_em.js +0 -4
- package/src/symbol/opacity_state.js +0 -27
- package/src/symbol/placement.js +0 -1062
- package/src/symbol/projection.js +0 -450
- package/src/symbol/quads.js +0 -334
- package/src/symbol/shaping.js +0 -816
- package/src/symbol/symbol_layout.js +0 -772
- package/src/symbol/symbol_size.js +0 -113
- package/src/symbol/transform_text.js +0 -29
- package/src/types/callback.js +0 -17
- package/src/types/cancelable.js +0 -3
- package/src/types/tilejson.js +0 -17
- package/src/types/transferable.js +0 -3
- package/src/types/window.js +0 -172
- package/src/ui/anchor.js +0 -32
- package/src/ui/bind_handlers.js +0 -202
- package/src/ui/camera.js +0 -1152
- package/src/ui/control/attribution_control.js +0 -189
- package/src/ui/control/fps_control.js +0 -185
- package/src/ui/control/fullscreen_control.js +0 -147
- package/src/ui/control/geolocate_control.js +0 -594
- package/src/ui/control/logo_control.js +0 -92
- package/src/ui/control/navigation_control.js +0 -148
- package/src/ui/control/scale_control.js +0 -142
- package/src/ui/crs.js +0 -64
- package/src/ui/default_locale.js +0 -20
- package/src/ui/events.js +0 -806
- package/src/ui/handler/box_zoom.js +0 -175
- package/src/ui/handler/dblclick_zoom.js +0 -139
- package/src/ui/handler/drag_pan.js +0 -416
- package/src/ui/handler/drag_rotate.js +0 -378
- package/src/ui/handler/keyboard.js +0 -161
- package/src/ui/handler/scroll_zoom.js +0 -333
- package/src/ui/handler/touch_zoom_rotate.js +0 -293
- package/src/ui/hash.js +0 -147
- package/src/ui/map.js +0 -2883
- package/src/ui/marker.js +0 -607
- package/src/ui/offline_map.js +0 -91
- package/src/ui/popup.js +0 -530
- package/src/util/actor.js +0 -212
- package/src/util/ajax.js +0 -371
- package/src/util/browser/web_worker.js +0 -10
- package/src/util/browser/window.js +0 -5
- package/src/util/browser.js +0 -70
- package/src/util/classify_rings.js +0 -52
- package/src/util/color_ramp.js +0 -28
- package/src/util/config.js +0 -30
- package/src/util/debug.js +0 -12
- package/src/util/dictionary_coder.js +0 -30
- package/src/util/dispatcher.js +0 -70
- package/src/util/dom.js +0 -144
- package/src/util/evented.js +0 -174
- package/src/util/find_pole_of_inaccessibility.js +0 -129
- package/src/util/global_worker_pool.js +0 -17
- package/src/util/image.js +0 -142
- package/src/util/intersection_tests.js +0 -208
- package/src/util/is_char_in_unicode_block.js +0 -311
- package/src/util/mapbox.js +0 -486
- package/src/util/offscreen_canvas_supported.js +0 -14
- package/src/util/performance.js +0 -112
- package/src/util/primitives.js +0 -145
- package/src/util/resolve_tokens.js +0 -16
- package/src/util/script_detection.js +0 -328
- package/src/util/sku_token.js +0 -42
- package/src/util/smart_wrap.js +0 -55
- package/src/util/struct_array.js +0 -243
- package/src/util/struct_array.js.ejs +0 -112
- package/src/util/struct_array_layout.js.ejs +0 -98
- package/src/util/task_queue.js +0 -68
- package/src/util/throttle.js +0 -28
- package/src/util/throttled_invoker.js +0 -46
- package/src/util/tile_cover.js +0 -101
- package/src/util/tile_request_cache.js +0 -172
- package/src/util/util.js +0 -504
- package/src/util/vectortile_to_geojson.js +0 -54
- package/src/util/verticalize_punctuation.js +0 -114
- package/src/util/web_worker.js +0 -91
- package/src/util/web_worker_transfer.js +0 -266
- package/src/util/webp_supported.js +0 -69
- package/src/util/window.js +0 -102
- package/src/util/worker_pool.js +0 -47
package/src/ui/events.js
DELETED
|
@@ -1,806 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import {Event} from '../util/evented';
|
|
4
|
-
|
|
5
|
-
import DOM from '../util/dom';
|
|
6
|
-
import Point from '@mapbox/point-geometry';
|
|
7
|
-
import {extend} from '../util/util';
|
|
8
|
-
|
|
9
|
-
import type Map from './map';
|
|
10
|
-
import type LngLat from '../geo/lng_lat';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* `MapMouseEvent` is the event type for mouse-related map events.
|
|
14
|
-
* @extends {Object}
|
|
15
|
-
*/
|
|
16
|
-
export class MapMouseEvent extends Event {
|
|
17
|
-
/**
|
|
18
|
-
* The event type.
|
|
19
|
-
*/
|
|
20
|
-
type: 'mousedown'
|
|
21
|
-
| 'mouseup'
|
|
22
|
-
| 'click'
|
|
23
|
-
| 'dblclick'
|
|
24
|
-
| 'mousemove'
|
|
25
|
-
| 'mouseover'
|
|
26
|
-
| 'mouseenter'
|
|
27
|
-
| 'mouseleave'
|
|
28
|
-
| 'mouseout'
|
|
29
|
-
| 'contextmenu';
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The `Map` object that fired the event.
|
|
33
|
-
*/
|
|
34
|
-
target: Map;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The DOM event which caused the map event.
|
|
38
|
-
*/
|
|
39
|
-
originalEvent: MouseEvent;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
|
|
43
|
-
*/
|
|
44
|
-
point: Point;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The geographic location on the map of the mouse cursor.
|
|
48
|
-
*/
|
|
49
|
-
lngLat: LngLat;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Prevents subsequent default processing of the event by the map.
|
|
53
|
-
*
|
|
54
|
-
* Calling this method will prevent the following default map behaviors:
|
|
55
|
-
*
|
|
56
|
-
* * On `mousedown` events, the behavior of {@link DragPanHandler}
|
|
57
|
-
* * On `mousedown` events, the behavior of {@link DragRotateHandler}
|
|
58
|
-
* * On `mousedown` events, the behavior of {@link BoxZoomHandler}
|
|
59
|
-
* * On `dblclick` events, the behavior of {@link DoubleClickZoomHandler}
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
preventDefault() {
|
|
63
|
-
this._defaultPrevented = true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* `true` if `preventDefault` has been called.
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
get defaultPrevented(): boolean {
|
|
71
|
-
return this._defaultPrevented;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
_defaultPrevented: boolean;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
constructor(type: string, map: Map, originalEvent: MouseEvent, data: Object = {}) {
|
|
80
|
-
const point = DOM.mousePos(map.getCanvasContainer(), originalEvent);
|
|
81
|
-
const lngLat = map.unproject(point);
|
|
82
|
-
super(type, extend({point, lngLat, originalEvent}, data));
|
|
83
|
-
this._defaultPrevented = false;
|
|
84
|
-
this.target = map;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* `MapTouchEvent` is the event type for touch-related map events.
|
|
90
|
-
* @extends {Object}
|
|
91
|
-
*/
|
|
92
|
-
export class MapTouchEvent extends Event {
|
|
93
|
-
/**
|
|
94
|
-
* The event type.
|
|
95
|
-
*/
|
|
96
|
-
type: 'touchstart'
|
|
97
|
-
| 'touchend'
|
|
98
|
-
| 'touchcancel';
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* The `Map` object that fired the event.
|
|
102
|
-
*/
|
|
103
|
-
target: Map;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The DOM event which caused the map event.
|
|
107
|
-
*/
|
|
108
|
-
originalEvent: TouchEvent;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The geographic location on the map of the center of the touch event points.
|
|
112
|
-
*/
|
|
113
|
-
lngLat: LngLat;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left
|
|
117
|
-
* corner.
|
|
118
|
-
*/
|
|
119
|
-
point: Point;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* The array of pixel coordinates corresponding to a
|
|
123
|
-
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
|
|
124
|
-
*/
|
|
125
|
-
points: Array<Point>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The geographical locations on the map corresponding to a
|
|
129
|
-
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
|
|
130
|
-
*/
|
|
131
|
-
lngLats: Array<LngLat>;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Prevents subsequent default processing of the event by the map.
|
|
135
|
-
*
|
|
136
|
-
* Calling this method will prevent the following default map behaviors:
|
|
137
|
-
*
|
|
138
|
-
* * On `touchstart` events, the behavior of {@link DragPanHandler}
|
|
139
|
-
* * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
preventDefault() {
|
|
143
|
-
this._defaultPrevented = true;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* `true` if `preventDefault` has been called.
|
|
148
|
-
* @private
|
|
149
|
-
*/
|
|
150
|
-
get defaultPrevented(): boolean {
|
|
151
|
-
return this._defaultPrevented;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
_defaultPrevented: boolean;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @private
|
|
158
|
-
*/
|
|
159
|
-
constructor(type: string, map: Map, originalEvent: TouchEvent) {
|
|
160
|
-
const points = DOM.touchPos(map.getCanvasContainer(), originalEvent);
|
|
161
|
-
const lngLats = points.map((t) => map.unproject(t));
|
|
162
|
-
const point = points.reduce((prev, curr, i, arr) => {
|
|
163
|
-
return prev.add(curr.div(arr.length));
|
|
164
|
-
}, new Point(0, 0));
|
|
165
|
-
const lngLat = map.unproject(point);
|
|
166
|
-
super(type, {points, point, lngLats, lngLat, originalEvent});
|
|
167
|
-
this._defaultPrevented = false;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* `MapWheelEvent` is the event type for the `wheel` map event.
|
|
173
|
-
* @extends {Object}
|
|
174
|
-
*/
|
|
175
|
-
export class MapWheelEvent extends Event {
|
|
176
|
-
/**
|
|
177
|
-
* The event type.
|
|
178
|
-
*/
|
|
179
|
-
type: 'wheel';
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The `Map` object that fired the event.
|
|
183
|
-
*/
|
|
184
|
-
target: Map;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* The DOM event which caused the map event.
|
|
188
|
-
*/
|
|
189
|
-
originalEvent: WheelEvent;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Prevents subsequent default processing of the event by the map.
|
|
193
|
-
*
|
|
194
|
-
* Calling this method will prevent the the behavior of {@link ScrollZoomHandler}.
|
|
195
|
-
*/
|
|
196
|
-
preventDefault() {
|
|
197
|
-
this._defaultPrevented = true;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* `true` if `preventDefault` has been called.
|
|
202
|
-
* @private
|
|
203
|
-
*/
|
|
204
|
-
get defaultPrevented(): boolean {
|
|
205
|
-
return this._defaultPrevented;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
_defaultPrevented: boolean;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @private
|
|
212
|
-
*/
|
|
213
|
-
constructor(type: string, map: Map, originalEvent: WheelEvent) {
|
|
214
|
-
super(type, {originalEvent});
|
|
215
|
-
this._defaultPrevented = false;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* A `MapBoxZoomEvent` is the event type for boxzoom-related map events.
|
|
221
|
-
* `originalEvent` can be a {@link Map.event:click} when the zoom is triggered by a UI event.
|
|
222
|
-
*
|
|
223
|
-
* @typedef {Object} MapBoxZoomEvent
|
|
224
|
-
* @property {MouseEvent} originalEvent
|
|
225
|
-
*/
|
|
226
|
-
export type MapBoxZoomEvent = {
|
|
227
|
-
type: 'boxzoomstart'
|
|
228
|
-
| 'boxzoomend'
|
|
229
|
-
| 'boxzoomcancel',
|
|
230
|
-
map: Map,
|
|
231
|
-
originalEvent: MouseEvent
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* A `MapDataEvent` object is emitted with the {@link Map.event:data}
|
|
236
|
-
* and {@link Map.event:dataloading} events. Possible values for
|
|
237
|
-
* `dataType`s are:
|
|
238
|
-
*
|
|
239
|
-
* - `'source'`: The non-tile data associated with any source
|
|
240
|
-
* - `'style'`: The [style](https://www.mapbox.com/mapbox-gl-style-spec/) used by the map
|
|
241
|
-
*
|
|
242
|
-
* @typedef {Object} MapDataEvent
|
|
243
|
-
* @property {string} type The event type.
|
|
244
|
-
* @property {string} dataType The type of data that has changed. One of `'source'`, `'style'`.
|
|
245
|
-
* @property {boolean} [isSourceLoaded] True if the event has a `dataType` of `source` and the source has no outstanding network requests.
|
|
246
|
-
* @property {Object} [source] The [style spec representation of the source](https://www.mapbox.com/mapbox-gl-style-spec/#sources) if the event has a `dataType` of `source`.
|
|
247
|
-
* @property {string} [sourceDataType] Included if the event has a `dataType` of `source` and the event signals
|
|
248
|
-
* that internal data has been received or changed. Possible values are `metadata` and `content`.
|
|
249
|
-
* @property {Object} [tile] The tile being loaded or changed, if the event has a `dataType` of `source` and
|
|
250
|
-
* the event is related to loading of a tile.
|
|
251
|
-
* @property {Coordinate} [coord] The coordinate of the tile if the event has a `dataType` of `source` and
|
|
252
|
-
* the event is related to loading of a tile.
|
|
253
|
-
*/
|
|
254
|
-
export type MapDataEvent = {
|
|
255
|
-
type: string,
|
|
256
|
-
dataType: string
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
export type MapContextEvent = {
|
|
260
|
-
type: 'webglcontextlost' | 'webglcontextrestored',
|
|
261
|
-
originalEvent: WebGLContextEvent
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export type MapEvent =
|
|
265
|
-
/**
|
|
266
|
-
* Fired when a pointing device (usually a mouse) is pressed within the map.
|
|
267
|
-
*
|
|
268
|
-
* @event mousedown
|
|
269
|
-
* @memberof Map
|
|
270
|
-
* @instance
|
|
271
|
-
* @property {MapMouseEvent} data
|
|
272
|
-
* @see [Highlight features within a bounding box](https://www.mapbox.com/mapbox-gl-js/example/using-box-queryrenderedfeatures/)
|
|
273
|
-
* @see [Create a draggable point](https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/)
|
|
274
|
-
*/
|
|
275
|
-
| 'mousedown'
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Fired when a pointing device (usually a mouse) is released within the map.
|
|
279
|
-
*
|
|
280
|
-
* @event mouseup
|
|
281
|
-
* @memberof Map
|
|
282
|
-
* @instance
|
|
283
|
-
* @property {MapMouseEvent} data
|
|
284
|
-
* @see [Highlight features within a bounding box](https://www.mapbox.com/mapbox-gl-js/example/using-box-queryrenderedfeatures/)
|
|
285
|
-
* @see [Create a draggable point](https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/)
|
|
286
|
-
*/
|
|
287
|
-
| 'mouseup'
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Fired when a pointing device (usually a mouse) is moved within the map.
|
|
291
|
-
*
|
|
292
|
-
* @event mouseover
|
|
293
|
-
* @memberof Map
|
|
294
|
-
* @instance
|
|
295
|
-
* @property {MapMouseEvent} data
|
|
296
|
-
* @see [Get coordinates of the mouse pointer](https://www.mapbox.com/mapbox-gl-js/example/mouse-position/)
|
|
297
|
-
* @see [Highlight features under the mouse pointer](https://www.mapbox.com/mapbox-gl-js/example/hover-styles/)
|
|
298
|
-
* @see [Display a popup on hover](https://www.mapbox.com/mapbox-gl-js/example/popup-on-hover/)
|
|
299
|
-
*/
|
|
300
|
-
| 'mouseover'
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Fired when a pointing device (usually a mouse) is moved within the map.
|
|
304
|
-
*
|
|
305
|
-
* @event mousemove
|
|
306
|
-
* @memberof Map
|
|
307
|
-
* @instance
|
|
308
|
-
* @property {MapMouseEvent} data
|
|
309
|
-
* @see [Get coordinates of the mouse pointer](https://www.mapbox.com/mapbox-gl-js/example/mouse-position/)
|
|
310
|
-
* @see [Highlight features under the mouse pointer](https://www.mapbox.com/mapbox-gl-js/example/hover-styles/)
|
|
311
|
-
* @see [Display a popup on over](https://www.mapbox.com/mapbox-gl-js/example/popup-on-hover/)
|
|
312
|
-
*/
|
|
313
|
-
| 'mousemove'
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
|
|
317
|
-
*
|
|
318
|
-
* @event click
|
|
319
|
-
* @memberof Map
|
|
320
|
-
* @instance
|
|
321
|
-
* @property {MapMouseEvent} data
|
|
322
|
-
* @see [Measure distances](https://www.mapbox.com/mapbox-gl-js/example/measure/)
|
|
323
|
-
* @see [Center the map on a clicked symbol](https://www.mapbox.com/mapbox-gl-js/example/center-on-symbol/)
|
|
324
|
-
*/
|
|
325
|
-
| 'click'
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Fired when a pointing device (usually a mouse) is clicked twice at the same point on the map.
|
|
329
|
-
*
|
|
330
|
-
* @event dblclick
|
|
331
|
-
* @memberof Map
|
|
332
|
-
* @instance
|
|
333
|
-
* @property {MapMouseEvent} data
|
|
334
|
-
*/
|
|
335
|
-
| 'dblclick'
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
|
|
339
|
-
* outside that layer or outside the map canvas. This event can only be listened for via the three-argument
|
|
340
|
-
* version of {@link Map#on}, where the second argument specifies the desired layer.
|
|
341
|
-
*
|
|
342
|
-
* @event mouseenter
|
|
343
|
-
* @memberof Map
|
|
344
|
-
* @instance
|
|
345
|
-
* @property {MapMouseEvent} data
|
|
346
|
-
*/
|
|
347
|
-
| 'mouseenter'
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
|
|
351
|
-
* the map canvas. This event can only be listened for via the three-argument version of {@link Map#on},
|
|
352
|
-
* where the second argument specifies the desired layer.
|
|
353
|
-
*
|
|
354
|
-
* @event mouseleave
|
|
355
|
-
* @memberof Map
|
|
356
|
-
* @instance
|
|
357
|
-
* @property {MapMouseEvent} data
|
|
358
|
-
* @see [Highlight features under the mouse pointer](https://www.mapbox.com/mapbox-gl-js/example/hover-styles/)
|
|
359
|
-
*/
|
|
360
|
-
| 'mouseleave'
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Fired when a point device (usually a mouse) leaves the map's canvas.
|
|
364
|
-
*
|
|
365
|
-
* @event mouseout
|
|
366
|
-
* @memberof Map
|
|
367
|
-
* @instance
|
|
368
|
-
* @property {MapMouseEvent} data
|
|
369
|
-
*/
|
|
370
|
-
| 'mouseout'
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
|
|
374
|
-
*
|
|
375
|
-
* @event contextmenu
|
|
376
|
-
* @memberof Map
|
|
377
|
-
* @instance
|
|
378
|
-
* @property {MapMouseEvent} data
|
|
379
|
-
*/
|
|
380
|
-
| 'contextmenu'
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
|
|
384
|
-
*
|
|
385
|
-
* @event wheel
|
|
386
|
-
* @memberof Map
|
|
387
|
-
* @instance
|
|
388
|
-
* @property {MapWheelEvent} data
|
|
389
|
-
*/
|
|
390
|
-
| 'wheel'
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
|
|
394
|
-
*
|
|
395
|
-
* @event touchstart
|
|
396
|
-
* @memberof Map
|
|
397
|
-
* @instance
|
|
398
|
-
* @property {MapTouchEvent} data
|
|
399
|
-
*/
|
|
400
|
-
| 'touchstart'
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
|
|
404
|
-
*
|
|
405
|
-
* @event touchend
|
|
406
|
-
* @memberof Map
|
|
407
|
-
* @instance
|
|
408
|
-
* @property {MapTouchEvent} data
|
|
409
|
-
*/
|
|
410
|
-
| 'touchend'
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
|
|
414
|
-
*
|
|
415
|
-
* @event touchmove
|
|
416
|
-
* @memberof Map
|
|
417
|
-
* @instance
|
|
418
|
-
* @property {MapTouchEvent} data
|
|
419
|
-
*/
|
|
420
|
-
| 'touchmove'
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
|
|
424
|
-
*
|
|
425
|
-
* @event touchcancel
|
|
426
|
-
* @memberof Map
|
|
427
|
-
* @instance
|
|
428
|
-
* @property {MapTouchEvent} data
|
|
429
|
-
*/
|
|
430
|
-
| 'touchcancel'
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Fired just before the map begins a transition from one
|
|
434
|
-
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
435
|
-
*
|
|
436
|
-
* @event movestart
|
|
437
|
-
* @memberof Map
|
|
438
|
-
* @instance
|
|
439
|
-
* @property {{originalEvent: DragEvent}} data
|
|
440
|
-
*/
|
|
441
|
-
| 'movestart'
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Fired repeatedly during an animated transition from one view to
|
|
445
|
-
* another, as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
446
|
-
*
|
|
447
|
-
* @event move
|
|
448
|
-
* @memberof Map
|
|
449
|
-
* @instance
|
|
450
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
451
|
-
*/
|
|
452
|
-
| 'move'
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Fired just after the map completes a transition from one
|
|
456
|
-
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
457
|
-
*
|
|
458
|
-
* @event moveend
|
|
459
|
-
* @memberof Map
|
|
460
|
-
* @instance
|
|
461
|
-
* @property {{originalEvent: DragEvent}} data
|
|
462
|
-
* @see [Play map locations as a slideshow](https://www.mapbox.com/mapbox-gl-js/example/playback-locations/)
|
|
463
|
-
* @see [Filter features within map view](https://www.mapbox.com/mapbox-gl-js/example/filter-features-within-map-view/)
|
|
464
|
-
*/
|
|
465
|
-
| 'moveend'
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
|
|
469
|
-
*
|
|
470
|
-
* @event dragstart
|
|
471
|
-
* @memberof Map
|
|
472
|
-
* @instance
|
|
473
|
-
* @property {{originalEvent: DragEvent}} data
|
|
474
|
-
*/
|
|
475
|
-
| 'dragstart'
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
|
|
479
|
-
*
|
|
480
|
-
* @event drag
|
|
481
|
-
* @memberof Map
|
|
482
|
-
* @instance
|
|
483
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
484
|
-
*/
|
|
485
|
-
| 'drag'
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
|
|
489
|
-
*
|
|
490
|
-
* @event dragend
|
|
491
|
-
* @memberof Map
|
|
492
|
-
* @instance
|
|
493
|
-
* @property {{originalEvent: DragEvent}} data
|
|
494
|
-
*/
|
|
495
|
-
| 'dragend'
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Fired just before the map begins a transition from one zoom level to another,
|
|
499
|
-
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
500
|
-
*
|
|
501
|
-
* @event zoomstart
|
|
502
|
-
* @memberof Map
|
|
503
|
-
* @instance
|
|
504
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
505
|
-
*/
|
|
506
|
-
| 'zoomstart'
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Fired repeatedly during an animated transition from one zoom level to another,
|
|
510
|
-
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
511
|
-
*
|
|
512
|
-
* @event zoom
|
|
513
|
-
* @memberof Map
|
|
514
|
-
* @instance
|
|
515
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
516
|
-
* @see [Update a choropleth layer by zoom level](https://www.mapbox.com/mapbox-gl-js/example/updating-choropleth/)
|
|
517
|
-
*/
|
|
518
|
-
| 'zoom'
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Fired just after the map completes a transition from one zoom level to another,
|
|
522
|
-
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
523
|
-
*
|
|
524
|
-
* @event zoomend
|
|
525
|
-
* @memberof Map
|
|
526
|
-
* @instance
|
|
527
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
528
|
-
*/
|
|
529
|
-
| 'zoomend'
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
|
|
533
|
-
*
|
|
534
|
-
* @event rotatestart
|
|
535
|
-
* @memberof Map
|
|
536
|
-
* @instance
|
|
537
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
538
|
-
*/
|
|
539
|
-
| 'rotatestart'
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
|
|
543
|
-
*
|
|
544
|
-
* @event rotate
|
|
545
|
-
* @memberof Map
|
|
546
|
-
* @instance
|
|
547
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
548
|
-
*/
|
|
549
|
-
| 'rotate'
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
* Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
|
|
553
|
-
*
|
|
554
|
-
* @event rotateend
|
|
555
|
-
* @memberof Map
|
|
556
|
-
* @instance
|
|
557
|
-
* @property {MapMouseEvent | MapTouchEvent} data
|
|
558
|
-
*/
|
|
559
|
-
| 'rotateend'
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* Fired whenever the map's pitch (tilt) begins a change as
|
|
563
|
-
* the result of either user interaction or methods such as {@link Map#flyTo} .
|
|
564
|
-
*
|
|
565
|
-
* @event pitchstart
|
|
566
|
-
* @memberof Map
|
|
567
|
-
* @instance
|
|
568
|
-
* @property {MapEventData} data
|
|
569
|
-
*/
|
|
570
|
-
| 'pitchstart'
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Fired whenever the map's pitch (tilt) changes as
|
|
574
|
-
* the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
575
|
-
*
|
|
576
|
-
* @event pitch
|
|
577
|
-
* @memberof Map
|
|
578
|
-
* @instance
|
|
579
|
-
* @property {MapEventData} data
|
|
580
|
-
*/
|
|
581
|
-
| 'pitch'
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Fired immediately after the map's pitch (tilt) finishes changing as
|
|
585
|
-
* the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
586
|
-
*
|
|
587
|
-
* @event pitchend
|
|
588
|
-
* @memberof Map
|
|
589
|
-
* @instance
|
|
590
|
-
* @property {MapEventData} data
|
|
591
|
-
*/
|
|
592
|
-
| 'pitchend'
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
|
|
596
|
-
*
|
|
597
|
-
* @event boxzoomstart
|
|
598
|
-
* @memberof Map
|
|
599
|
-
* @instance
|
|
600
|
-
* @property {MapBoxZoomEvent} data
|
|
601
|
-
*/
|
|
602
|
-
| 'boxzoomstart'
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
|
|
606
|
-
*
|
|
607
|
-
* @event boxzoomend
|
|
608
|
-
* @memberof Map
|
|
609
|
-
* @instance
|
|
610
|
-
* @type {Object}
|
|
611
|
-
* @property {MapBoxZoomEvent} data
|
|
612
|
-
*/
|
|
613
|
-
| 'boxzoomend'
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
|
|
617
|
-
* See {@link BoxZoomHandler}.
|
|
618
|
-
*
|
|
619
|
-
* @event boxzoomcancel
|
|
620
|
-
* @memberof Map
|
|
621
|
-
* @instance
|
|
622
|
-
* @property {MapBoxZoomEvent} data
|
|
623
|
-
*/
|
|
624
|
-
| 'boxzoomcancel'
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* Fired immediately after the map has been resized.
|
|
628
|
-
*
|
|
629
|
-
* @event resize
|
|
630
|
-
* @memberof Map
|
|
631
|
-
* @instance
|
|
632
|
-
*/
|
|
633
|
-
| 'resize'
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* Fired when the WebGL context is lost.
|
|
637
|
-
*
|
|
638
|
-
* @event webglcontextlost
|
|
639
|
-
* @memberof Map
|
|
640
|
-
* @instance
|
|
641
|
-
*/
|
|
642
|
-
| 'webglcontextlost'
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Fired when the WebGL context is restored.
|
|
646
|
-
*
|
|
647
|
-
* @event webglcontextrestored
|
|
648
|
-
* @memberof Map
|
|
649
|
-
* @instance
|
|
650
|
-
*/
|
|
651
|
-
| 'webglcontextrestored'
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Fired immediately after all necessary resources have been downloaded
|
|
655
|
-
* and the first visually complete rendering of the map has occurred.
|
|
656
|
-
*
|
|
657
|
-
* @event load
|
|
658
|
-
* @memberof Map
|
|
659
|
-
* @instance
|
|
660
|
-
* @type {Object}
|
|
661
|
-
* @see [Draw GeoJSON points](https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/)
|
|
662
|
-
* @see [Add live realtime data](https://www.mapbox.com/mapbox-gl-js/example/live-geojson/)
|
|
663
|
-
* @see [Animate a point](https://www.mapbox.com/mapbox-gl-js/example/animate-point-along-line/)
|
|
664
|
-
*/
|
|
665
|
-
| 'load'
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* Fired whenever the map is drawn to the screen, as the result of
|
|
669
|
-
*
|
|
670
|
-
* - a change to the map's position, zoom, pitch, or bearing
|
|
671
|
-
* - a change to the map's style
|
|
672
|
-
* - a change to a GeoJSON source
|
|
673
|
-
* - the loading of a vector tile, GeoJSON file, glyph, or sprite
|
|
674
|
-
*
|
|
675
|
-
* @event render
|
|
676
|
-
* @memberof Map
|
|
677
|
-
* @instance
|
|
678
|
-
*/
|
|
679
|
-
| 'render'
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Fired after the last frame rendered before the map enters an
|
|
683
|
-
* "idle" state:
|
|
684
|
-
*
|
|
685
|
-
* - No camera transitions are in progress
|
|
686
|
-
* - All currently requested tiles have loaded
|
|
687
|
-
* - All fade/transition animations have completed
|
|
688
|
-
*
|
|
689
|
-
* @event idle
|
|
690
|
-
* @memberof Map
|
|
691
|
-
* @instance
|
|
692
|
-
*/
|
|
693
|
-
| 'idle'
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* Fired immediately after the map has been removed with {@link Map.event:remove}.
|
|
697
|
-
*
|
|
698
|
-
* @event remove
|
|
699
|
-
* @memberof Map
|
|
700
|
-
* @instance
|
|
701
|
-
*/
|
|
702
|
-
| 'remove'
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* Fired when an error occurs. This is GL JS's primary error reporting
|
|
706
|
-
* mechanism. We use an event instead of `throw` to better accommodate
|
|
707
|
-
* asyncronous operations. If no listeners are bound to the `error` event, the
|
|
708
|
-
* error will be printed to the console.
|
|
709
|
-
*
|
|
710
|
-
* @event error
|
|
711
|
-
* @memberof Map
|
|
712
|
-
* @instance
|
|
713
|
-
* @property {{error: {message: string}}} data
|
|
714
|
-
*/
|
|
715
|
-
| 'error'
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* Fired when any map data loads or changes. See {@link MapDataEvent}
|
|
719
|
-
* for more information.
|
|
720
|
-
*
|
|
721
|
-
* @event data
|
|
722
|
-
* @memberof Map
|
|
723
|
-
* @instance
|
|
724
|
-
* @property {MapDataEvent} data
|
|
725
|
-
*/
|
|
726
|
-
| 'data'
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Fired when the map's style loads or changes. See
|
|
730
|
-
* {@link MapDataEvent} for more information.
|
|
731
|
-
*
|
|
732
|
-
* @event styledata
|
|
733
|
-
* @memberof Map
|
|
734
|
-
* @instance
|
|
735
|
-
* @property {MapDataEvent} data
|
|
736
|
-
*/
|
|
737
|
-
| 'styledata'
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* Fired when one of the map's sources loads or changes, including if a tile belonging
|
|
741
|
-
* to a source loads or changes. See {@link MapDataEvent} for more information.
|
|
742
|
-
*
|
|
743
|
-
* @event sourcedata
|
|
744
|
-
* @memberof Map
|
|
745
|
-
* @instance
|
|
746
|
-
* @property {MapDataEvent} data
|
|
747
|
-
*/
|
|
748
|
-
| 'sourcedata'
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* Fired when any map data (style, source, tile, etc) begins loading or
|
|
752
|
-
* changing asyncronously. All `dataloading` events are followed by a `data`
|
|
753
|
-
* or `error` event. See {@link MapDataEvent} for more information.
|
|
754
|
-
*
|
|
755
|
-
* @event dataloading
|
|
756
|
-
* @memberof Map
|
|
757
|
-
* @instance
|
|
758
|
-
* @property {MapDataEvent} data
|
|
759
|
-
*/
|
|
760
|
-
| 'dataloading'
|
|
761
|
-
|
|
762
|
-
/**
|
|
763
|
-
* Fired when the map's style begins loading or changing asyncronously.
|
|
764
|
-
* All `styledataloading` events are followed by a `styledata`
|
|
765
|
-
* or `error` event. See {@link MapDataEvent} for more information.
|
|
766
|
-
*
|
|
767
|
-
* @event styledataloading
|
|
768
|
-
* @memberof Map
|
|
769
|
-
* @instance
|
|
770
|
-
* @property {MapDataEvent} data
|
|
771
|
-
*/
|
|
772
|
-
| 'styledataloading'
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Fired when one of the map's sources begins loading or changing asyncronously.
|
|
776
|
-
* All `sourcedataloading` events are followed by a `sourcedata` or `error` event.
|
|
777
|
-
* See {@link MapDataEvent} for more information.
|
|
778
|
-
*
|
|
779
|
-
* @event sourcedataloading
|
|
780
|
-
* @memberof Map
|
|
781
|
-
* @instance
|
|
782
|
-
* @property {MapDataEvent} data
|
|
783
|
-
*/
|
|
784
|
-
| 'sourcedataloading'
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* Fired when an icon or pattern needed by the style is missing. The missing image can
|
|
788
|
-
* be added with {@link Map#addImage} within this event listener callback to prevent the image from
|
|
789
|
-
* being skipped. This event can be used to dynamically generate icons and patterns.
|
|
790
|
-
*
|
|
791
|
-
* @event styleimagemissing
|
|
792
|
-
* @memberof Map
|
|
793
|
-
* @instance
|
|
794
|
-
* @property {string} id The id of the missing image.
|
|
795
|
-
*
|
|
796
|
-
* @see [Generate and add a missing icon to the map](https://mapbox.com/mapbox-gl-js/example/add-image-missing-generated/)
|
|
797
|
-
*/
|
|
798
|
-
| 'styleimagemissing'
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
* @event style.load
|
|
802
|
-
* @memberof Map
|
|
803
|
-
* @instance
|
|
804
|
-
* @private
|
|
805
|
-
*/
|
|
806
|
-
| 'style.load';
|