├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── valentingrigorean │ │ └── arcgis_maps_flutter │ │ ├── ArcgisMapsFlutterPlugin.java │ │ ├── Convert.java │ │ ├── LifecycleProvider.java │ │ ├── concurrent │ │ ├── ConvertConcurrent.java │ │ └── JobNativeHandler.java │ │ ├── data │ │ ├── FieldTypeFlutter.java │ │ ├── GeodatabaseNativeObject.java │ │ └── TileCacheNativeObject.java │ │ ├── flutterobject │ │ ├── ArcgisNativeObjectFactory.java │ │ ├── ArcgisNativeObjectFactoryImpl.java │ │ ├── ArcgisNativeObjectsController.java │ │ ├── BaseNativeHandler.java │ │ ├── BaseNativeObject.java │ │ ├── NativeHandler.java │ │ ├── NativeMessageSink.java │ │ ├── NativeObject.java │ │ ├── NativeObjectMessageSink.java │ │ └── NativeObjectStorage.java │ │ ├── geometry │ │ ├── CoordinateFormatterController.java │ │ └── GeometryEngineController.java │ │ ├── io │ │ ├── ApiKeyResourceNativeHandler.java │ │ └── RemoteResourceNativeHandler.java │ │ ├── layers │ │ ├── FlutterLayer.java │ │ ├── FlutterServiceImageTiledLayer.java │ │ ├── LayersChangedController.java │ │ ├── LayersController.java │ │ ├── LegendInfoController.java │ │ └── MapChangeAware.java │ │ ├── loadable │ │ └── LoadableNativeHandler.java │ │ ├── map │ │ ├── ArcgisMapController.java │ │ ├── ArcgisMapFactory.java │ │ ├── BaseGraphicController.java │ │ ├── BaseSymbolController.java │ │ ├── BitmapDescriptor.java │ │ ├── BitmapDescriptorFactory.java │ │ ├── FlutterMapView.java │ │ ├── FlutterMapViewDelegate.java │ │ ├── GraphicControllerSink.java │ │ ├── InvalidateMapHelper.java │ │ ├── LocationDisplayController.java │ │ ├── MapTouchGraphicDelegate.java │ │ ├── MapViewOnTouchListener.java │ │ ├── MarkerController.java │ │ ├── MarkerControllerSink.java │ │ ├── MarkersController.java │ │ ├── PolygonController.java │ │ ├── PolygonControllerSink.java │ │ ├── PolygonsController.java │ │ ├── PolylineController.java │ │ ├── PolylineControllerSink.java │ │ ├── PolylinesController.java │ │ ├── ScaleBarController.java │ │ ├── ScaleSymbol.java │ │ ├── ScreenLocationData.java │ │ ├── SelectionPropertiesHandler.java │ │ ├── SymbolVisibilityFilter.java │ │ ├── SymbolVisibilityFilterController.java │ │ └── SymbolsController.java │ │ ├── scene │ │ ├── ArcgisSceneController.java │ │ ├── ArcgisSceneViewFactory.java │ │ └── SceneController.java │ │ ├── service_table │ │ └── ServiceTableController.kt │ │ ├── tasks │ │ ├── geocode │ │ │ ├── ConvertLocatorTask.java │ │ │ └── LocatorTaskNativeObject.java │ │ ├── geodatabase │ │ │ ├── ConvertGeodatabase.java │ │ │ ├── GenerateGeodatabaseJobNativeObject.java │ │ │ ├── GeodatabaseSyncTaskNativeObject.java │ │ │ └── SyncGeodatabaseJobNativeObject.java │ │ ├── networkanalysis │ │ │ ├── ConvertRouteTask.java │ │ │ └── RouteTaskNativeObject.java │ │ ├── offlinemap │ │ │ ├── ConvertOfflineMap.java │ │ │ ├── GenerateOfflineMapJobNativeObject.java │ │ │ ├── OfflineMapSyncJobNativeObject.java │ │ │ ├── OfflineMapSyncTaskNativeObject.java │ │ │ └── OfflineMapTaskNativeObject.java │ │ └── tilecache │ │ │ ├── ConvertTileCache.java │ │ │ ├── EstimateTileCacheSizeJobNativeObjectNativeObject.java │ │ │ ├── ExportTileCacheJobNativeObject.java │ │ │ └── ExportTileCacheTaskNativeObject.java │ │ ├── toolkit │ │ ├── extension │ │ │ ├── ArcGISExtensions.kt │ │ │ ├── ClassExtensions.kt │ │ │ ├── NumberExtensions.kt │ │ │ └── ScalebarRendererExtensions.kt │ │ └── scalebar │ │ │ ├── Constants.kt │ │ │ ├── Multiplier.kt │ │ │ ├── Scalebar.kt │ │ │ └── style │ │ │ ├── Style.kt │ │ │ └── renderer │ │ │ ├── AlternatingBarRenderer.kt │ │ │ ├── BarRenderer.kt │ │ │ ├── DualUnitLineNauticalMileRenderer.kt │ │ │ ├── DualUnitLineRenderer.kt │ │ │ ├── GraduatedLineRenderer.kt │ │ │ ├── LineRenderer.kt │ │ │ └── ScalebarRenderer.kt │ │ └── utils │ │ ├── AGSLoadObjects.java │ │ ├── ArcGisConverters.kt │ │ ├── LoadStatusChangedListenerLogger.java │ │ └── StringUtils.java │ └── res │ └── values │ ├── attrs.xml │ └── dimens.xml ├── assets ├── 2.0x │ └── ic_compass.png ├── 3.0x │ └── ic_compass.png └── ic_compass.png ├── example ├── .env-sample ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── valentingrigorean │ │ │ │ │ └── arcgis_maps_flutter_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ ├── ic_flight_hazard.xml │ │ │ │ ├── ic_marker.xml │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ ├── Yellowstone.mmpk │ └── map.json ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ ├── Contents.json │ │ ├── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── ic_flight_hazard.imageset │ │ │ ├── Contents.json │ │ │ └── ic_flighthazard.pdf │ │ └── ic_marker.imageset │ │ │ ├── Contents.json │ │ │ └── ic_poi.pdf │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── main.dart │ ├── map_page.dart │ ├── map_page_assets_marker.dart │ ├── map_page_auto_pan_mode.dart │ ├── map_page_buffer.dart │ ├── map_page_current_location_tap.dart │ ├── map_page_dynamic_layer.dart │ ├── map_page_export_image.dart │ ├── map_page_feature_service_offline.dart │ ├── map_page_geodesic_distance.dart │ ├── map_page_geodesic_sector.dart │ ├── map_page_geometry_engine.dart │ ├── map_page_gesture.dart │ ├── map_page_group_layer.dart │ ├── map_page_layers_change.dart │ ├── map_page_legend.dart │ ├── map_page_locator.dart │ ├── map_page_marker_from_widget.dart │ ├── map_page_marker_rotation.dart │ ├── map_page_markers.dart │ ├── map_page_markers_visibility_filter.dart │ ├── map_page_max_extent.dart │ ├── map_page_mobile_map_package.dart │ ├── map_page_offline_map.dart │ ├── map_page_polygon.dart │ ├── map_page_portal.dart │ ├── map_page_route.dart │ ├── map_page_scalerbar.dart │ ├── map_page_screen_location.dart │ ├── map_page_scrolling_list.dart │ ├── map_page_tile_cache.dart │ ├── map_page_time_slider.dart │ ├── map_page_view_insests.dart │ ├── scene_page.dart │ ├── utils.dart │ └── utils │ │ ├── arcgis_maps_utils.dart │ │ ├── credentials.dart │ │ └── models.dart ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── generator.sh ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── ArcgisMapsFlutterPlugin.h │ ├── ArcgisMapsFlutterPlugin.m │ ├── Concurrent │ │ └── JobNativeHandler.swift │ ├── Convert │ │ ├── AGSAttributeParameterValue+Flutter.swift │ │ ├── AGSCostAttribute+Flutter.swift │ │ ├── AGSCredential+Flutter.swift │ │ ├── AGSDirectionEvent+Flutter.swift │ │ ├── AGSDirectionManeuver+Flutter.swift │ │ ├── AGSDirectionMessage+Flutter.swift │ │ ├── AGSEditResult+Flutter.swift │ │ ├── AGSEnum+Flutter.swift │ │ ├── AGSEnvelope+Flutter.swift │ │ ├── AGSExportTileCacheParameters+Flutter.swift │ │ ├── AGSFeature+Flutter.swift │ │ ├── AGSGenerateGeodatabaseParameters+Flutter.swift │ │ ├── AGSGenerateLayerOption+Flutter.swift │ │ ├── AGSGenerateOfflineMapParameters+Flutter.swift │ │ ├── AGSGeoElement+Flutter.swift │ │ ├── AGSGeocodeParameters+Flutter.swift │ │ ├── AGSGeocodeResult+Flutter.swift │ │ ├── AGSGeodatabaseDeltaInfo+Flutter.swift │ │ ├── AGSGeodesicSectorParameters+Flutter.swift │ │ ├── AGSGeometry+Flutter.swift │ │ ├── AGSGraphic+Flutter.swift │ │ ├── AGSIdentifyLayerResult+Flutter.swift │ │ ├── AGSJobMessage+Flutter.swift │ │ ├── AGSLevelOfDetail+Flutter.swift │ │ ├── AGSLocation+Flutter.swift │ │ ├── AGSLocatorInfo+Flutter.swift │ │ ├── AGSMap+Flutter.swift │ │ ├── AGSOfflineMapItemInfo+Flutter.swift │ │ ├── AGSOfflineMapSyncParameters+Flutter.swift │ │ ├── AGSOfflineMapSyncResult+Flutter.swift │ │ ├── AGSOfflineMapUpdateCapabilities+Flutter.swift │ │ ├── AGSOfflineMapUpdatesInfo+Flutter.swift │ │ ├── AGSPoint+Flutter.swift │ │ ├── AGSPortal+Flutter.swift │ │ ├── AGSPortalItem+Flutter.swift │ │ ├── AGSRestrictionAttribute+Flutter.swift │ │ ├── AGSReverseGeocodeParameters+Flutter.swift │ │ ├── AGSRoute+Flutter.swift │ │ ├── AGSRouteParameters+Flutter.swift │ │ ├── AGSRouteResult+Flutter.swift │ │ ├── AGSRouteTaskInfo+Flutter.swift │ │ ├── AGSSpatialReference+Flutter.swift │ │ ├── AGSStop+Flutter.swift │ │ ├── AGSSuggestParameters+Flutter.swift │ │ ├── AGSSuggestResult+Flutter.swift │ │ ├── AGSSyncGeodatabaseParameters+Flutter.swift │ │ ├── AGSSyncLayerOption+Flutter.swift │ │ ├── AGSSyncLayerResult+Flutter.swift │ │ ├── AGSTileCache+Flutter.swift │ │ ├── AGSTileInfo+Flutter.swift │ │ ├── AGSTimeAware+Flutter.swift │ │ ├── AGSTimeExtent+Flutter.swift │ │ ├── AGSTimeValue+Flutter.swift │ │ ├── AGSTravelMode+Flutter.swift │ │ ├── AGSViewpoint+Flutter.swift │ │ ├── ArcGISEnum+Flutter.swift │ │ ├── Attributes+Flutter.swift │ │ ├── CGPoint+JSON.swift │ │ ├── Date.swift │ │ ├── Error+Flutter.swift │ │ ├── GeodeticDistanceResult+Flutter.swift │ │ ├── ScalebarAlignment+Flutter.swift │ │ ├── UIColor+Flutter.swift │ │ └── UIImage+Flutter.swift │ ├── Data │ │ ├── FieldTypeFlutter.swift │ │ ├── GeodatabaseNativeObject.swift │ │ └── TileCacheNativeObject.swift │ ├── FlutterObject │ │ ├── ArcgisNativeObjectFactoryImpl.swift │ │ ├── ArcgisNativeObjectsController.swift │ │ ├── NativeObject.swift │ │ └── NativeObjectStorage.swift │ ├── Geometry │ │ ├── CoordinateFormatterController.swift │ │ └── GeometryEngineController.swift │ ├── IO │ │ ├── ApiKeyResourceNativeHandler.swift │ │ └── RemoteResourceNativeHandler.swift │ ├── Layers │ │ ├── FlutterLayer.swift │ │ ├── FlutterServiceImageTiledLayer.swift │ │ ├── LegendInfoController.swift │ │ └── TimeAwareLayersController.swift │ ├── Loadable │ │ └── LoadableNativeHandler.swift │ ├── Map │ │ ├── ArcgisMapController.swift │ │ ├── ArcgisMapFactory.swift │ │ ├── BaseGraphicController.swift │ │ ├── BitmapDescriptor.swift │ │ ├── LayersChangedController.swift │ │ ├── LayersController.swift │ │ ├── LocationDisplayController.swift │ │ ├── MapGraphicTouchDelegate.swift │ │ ├── MarkerController.swift │ │ ├── MarkersController.swift │ │ ├── PolygonController.swift │ │ ├── PolygonsController.swift │ │ ├── PolylineController.swift │ │ ├── PolylinesController.swift │ │ ├── ScaleBarController.swift │ │ ├── ScaleSymbolHelper.swift │ │ ├── SelectionPropertiesHandler.swift │ │ ├── SymbolVisibilityFilterController.swift │ │ └── SymbolsController.swift │ ├── ServiceTable │ │ └── ArcGisServiceTableController.swift │ ├── SwiftArcgisMapsFlutterPlugin.swift │ ├── Tasks │ │ ├── Geocode │ │ │ └── LocatorTaskNativeObject.swift │ │ ├── Geodatabase │ │ │ ├── GenerateGeodatabaseJobNativeObject.swift │ │ │ ├── GeodatabaseSyncTaskNativeObject.swift │ │ │ └── SyncGeodatabaseJobNativeObject.swift │ │ ├── NetworkAnalysis │ │ │ └── RouteTaskNativeObject.swift │ │ ├── OfflineMap │ │ │ ├── AGSOfflineMapSyncJobNativeObject.swift │ │ │ ├── GenerateOfflineMapJobNativeObject.swift │ │ │ ├── OfflineMapSyncTaskNativeObject.swift │ │ │ └── OfflineMapTaskNativeObject.swift │ │ └── TileCache │ │ │ ├── EstimateTileCacheSizeJobNativeObject.swift │ │ │ ├── ExportTileCacheJobNativeObject.swift │ │ │ └── ExportTileCacheTaskNativeObject.swift │ ├── Toolkit │ │ ├── Coalescer.swift │ │ └── Scalebar.swift │ └── Utils │ │ ├── DispatchQueue+Ext.swift │ │ ├── ImageCache.swift │ │ ├── NSNumber+Ext.swift │ │ └── UIImage+UIColor.swift └── arcgis_maps_flutter.podspec ├── lib ├── arcgis_maps_flutter.dart └── src │ ├── arcgis_error.dart │ ├── arcgis_native_object.dart │ ├── arcgis_runtime_environment.dart │ ├── arcgisservices │ ├── level_of_detail.dart │ └── tile_info.dart │ ├── concurrent │ └── job.dart │ ├── data │ ├── edit_result.dart │ ├── field_type.dart │ ├── geodatabase.dart │ ├── query_parameters.dart │ ├── statistic │ │ ├── statistic.dart │ │ └── statistic_result.dart │ ├── sync_model.dart │ ├── tile_cache.dart │ └── tile_key.dart │ ├── dispose_scope.dart │ ├── feature │ └── feature.dart │ ├── geometry │ ├── ags_envelope.dart │ ├── ags_multipoint.dart │ ├── ags_point.dart │ ├── ags_polygon.dart │ ├── ags_polyline.dart │ ├── area_unit.dart │ ├── coordinate_formatter.dart │ ├── geodesic_sector_parameters.dart │ ├── geodetic_distance_result.dart │ ├── geometry.dart │ ├── geometry_engine.dart │ ├── geometry_type.dart │ └── spatial_references.dart │ ├── io │ ├── api_key_resource.dart │ ├── remote_resource.dart │ └── request_configuration.dart │ ├── layers │ ├── base_tile_layer.dart │ ├── feature_collection_layer.dart │ ├── feature_layer.dart │ ├── geodatabase_layer.dart │ ├── group_layer.dart │ ├── layer.dart │ ├── layer_updates.dart │ ├── legend_info.dart │ ├── legend_info_result.dart │ ├── map_image_layer.dart │ ├── service_image_tiled_layer.dart │ ├── tiled_layer.dart │ ├── time_aware_layer_info.dart │ ├── vector_tile_layer.dart │ └── wms_layer.dart │ ├── loadable │ └── loadable.dart │ ├── location │ └── location.dart │ ├── mapping │ ├── arcgis_map.dart │ ├── arcgis_scene.dart │ ├── arcgis_tiled_elevation_source.dart │ ├── basemap_type_options.dart │ ├── camera.dart │ ├── elevation_source.dart │ ├── geo_element.dart │ ├── layer_list.dart │ ├── mobile_map_package.dart │ ├── surface.dart │ ├── time_extent.dart │ ├── time_value.dart │ ├── view │ │ ├── auto_pan_mode.dart │ │ ├── identify_layer_result.dart │ │ ├── interaction_options.dart │ │ ├── layers_changed_listener.dart │ │ ├── location_display.dart │ │ ├── location_display_impl.dart │ │ ├── map │ │ │ ├── arcgis_map_controller.dart │ │ │ └── arcgis_map_view.dart │ │ ├── scalebar_configuration.dart │ │ ├── scene │ │ │ ├── arcgis_scene_controller.dart │ │ │ └── arcgis_scene_view.dart │ │ ├── time_extent_changed_listener.dart │ │ ├── viewpoint_changed_listener.dart │ │ └── zoom_level.dart │ ├── viewpoint.dart │ └── viewpoint_type.dart │ ├── maps_object.dart │ ├── maps_object_updates.dart │ ├── method_channel │ ├── arcgis_flutter_platform.dart │ ├── geometry │ │ ├── coordinate_formatter_flutter_platform.dart │ │ ├── geometry_engine_flutter_platform.dart │ │ ├── method_channel_coordinate_formatter_flutter.dart │ │ └── method_channel_geometry_engine_flutter.dart │ ├── map │ │ ├── arcgis_maps_flutter_platform.dart │ │ ├── map_event.dart │ │ └── method_channel_arcgis_maps_flutter.dart │ ├── method_channel_arcgis_flutter.dart │ ├── native │ │ ├── arcgis_native_flutter_platform.dart │ │ ├── method_channel_arcgis_native_flutter.dart │ │ └── native_message.dart │ ├── scene │ │ ├── arcgis_scene_flutter_platform.dart │ │ └── method_channel_arcgis_scene_flutter.dart │ └── service_table │ │ ├── method_channel_service_table_flutter.dart │ │ └── service_table_flutter_platform.dart │ ├── ogc │ └── wms │ │ ├── wms_layer_dimension.dart │ │ ├── wms_layer_info.dart │ │ ├── wms_layer_style.dart │ │ ├── wms_layer_time_dimension.dart │ │ ├── wms_service.dart │ │ ├── wms_service_info.dart │ │ └── wms_version.dart │ ├── portal │ ├── portal.dart │ └── portal_item.dart │ ├── security │ ├── credential.dart │ └── user_credential.dart │ ├── service_table │ └── service_table.dart │ ├── symbology │ ├── bitmap_descriptor.dart │ ├── cluster_item.dart │ ├── marker.dart │ ├── marker_updates.dart │ ├── polygon.dart │ ├── polygon_updates.dart │ ├── polyline.dart │ ├── polyline_updates.dart │ ├── symbol.dart │ └── symbol_visibility_filter.dart │ ├── tasks │ ├── geocode │ │ ├── geocode_parameters.dart │ │ ├── geocode_result.dart │ │ ├── locator_attribute.dart │ │ ├── locator_info.dart │ │ ├── locator_task.dart │ │ ├── reverse_geocode_parameters.dart │ │ ├── suggest_parameters.dart │ │ └── suggest_result.dart │ ├── geodatabase │ │ ├── generate_geodatabase_job.dart │ │ ├── generate_geodatabase_parameters.dart │ │ ├── generate_layer_option.dart │ │ ├── geodatabase_delta_info.dart │ │ ├── geodatabase_sync_task.dart │ │ ├── sync_geodatabase_job.dart │ │ └── sync_geodatabase_parameters.dart │ ├── network_analysis │ │ ├── attribute_parameter_value.dart │ │ ├── cost_attribute.dart │ │ ├── direction_event.dart │ │ ├── direction_maneuver.dart │ │ ├── direction_message.dart │ │ ├── restriction_attribute.dart │ │ ├── route.dart │ │ ├── route_parameters.dart │ │ ├── route_result.dart │ │ ├── route_task.dart │ │ ├── route_task_info.dart │ │ ├── route_types.dart │ │ ├── stop.dart │ │ └── travel_mode.dart │ ├── offline_map │ │ ├── generate_offline_map_job.dart │ │ ├── generate_offline_map_parameters.dart │ │ ├── generate_offline_map_result.dart │ │ ├── offline_map_item_info.dart │ │ ├── offline_map_sync_job.dart │ │ ├── offline_map_sync_task.dart │ │ └── offline_map_task.dart │ └── tile_cache │ │ ├── estimate_tile_cache_size_job.dart │ │ ├── export_tile_cache_job.dart │ │ ├── export_tile_cache_parameters.dart │ │ └── export_tile_cache_task.dart │ ├── toolkit │ ├── compass.dart │ └── time_slider │ │ ├── flutter_xlider.dart │ │ ├── time_slider.dart │ │ └── time_slider_data_provider.dart │ ├── unit_system.dart │ └── utils │ ├── elevation_source.dart │ ├── json.dart │ ├── layers.dart │ ├── maps_object.dart │ ├── markers.dart │ ├── polygons.dart │ └── polyline.dart ├── pubspec.yaml └── test ├── arcgis_runtime_environment_test.dart ├── geometry └── ags_multipoint_test.dart ├── layers ├── base_tile_layer_test.dart ├── feature_layer_test.dart ├── layer_test.dart └── wms_layer_test.dart ├── ogc.wms ├── wms_layer_dimension_test.dart └── wms_service_test.dart └── toolkit └── time_slider_test.dart /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Valentin Grigorean 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # arcgis_maps_flutter 2 | 3 | ## Deprecation Notice 4 | 5 | This plugin is no longer actively maintained. Esri has announced the official [ArcGIS Maps SDK for Flutter](https://www.esri.com/arcgis-blog/products/developers/announcements/announcing-arcgis-maps-sdk-for-flutter-beta/), which provides comprehensive mapping capabilities directly supported by Esri. 6 | 7 | ## Recommendation 8 | 9 | We strongly recommend transitioning to the [ArcGIS Maps SDK for Flutter](https://www.esri.com/arcgis-blog/products/developers/announcements/announcing-arcgis-maps-sdk-for-flutter-beta/). This official SDK will ensure better support and access to the latest features and updates from Esri. 10 | 11 | Thank you for your understanding and support. 12 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | 2 | include: package:flutter_lints/flutter.yaml 3 | 4 | analyzer: 5 | exclude: 6 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.valentingrigorean.arcgis_maps_flutter' 2 | version '1.0' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.7.10' 6 | 7 | 8 | repositories { 9 | google() 10 | mavenCentral() 11 | } 12 | 13 | dependencies { 14 | classpath 'com.android.tools.build:gradle:7.4.1' 15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 16 | } 17 | } 18 | 19 | rootProject.allprojects { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | 24 | maven { 25 | url 'https://esri.jfrog.io/artifactory/arcgis' 26 | } 27 | } 28 | } 29 | 30 | apply plugin: 'com.android.library' 31 | apply plugin: 'kotlin-android' 32 | 33 | 34 | android { 35 | namespace 'com.valentingrigorean.arcgis_maps_flutter' 36 | compileSdkVersion 33 37 | 38 | defaultConfig { 39 | minSdkVersion 26 40 | } 41 | 42 | lintOptions { 43 | disable 'InvalidPackage' 44 | } 45 | 46 | dependencies { 47 | implementation 'com.esri.arcgisruntime:arcgis-android:100.15.0' 48 | implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0' 49 | implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0' 50 | } 51 | 52 | packagingOptions { 53 | pickFirst "META-INF/DEPENDENCIES" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'arcgis_maps_flutter' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/LifecycleProvider.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter; 2 | 3 | import androidx.annotation.Nullable; 4 | import androidx.lifecycle.Lifecycle; 5 | 6 | public interface LifecycleProvider { 7 | 8 | @Nullable 9 | Lifecycle getLifecycle(); 10 | } -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/concurrent/ConvertConcurrent.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.concurrent; 2 | 3 | import com.esri.arcgisruntime.concurrent.Job; 4 | import com.valentingrigorean.arcgis_maps_flutter.Convert; 5 | 6 | import java.util.HashMap; 7 | 8 | public class ConvertConcurrent extends Convert { 9 | 10 | public static Object jobMessageToJson(Job.Message message) { 11 | final HashMap json = new HashMap<>(4); 12 | json.put("message", message.getMessage()); 13 | json.put("severity", message.getSeverity() == Job.MessageSeverity.UNKNOWN ? -1 : message.getSeverity().ordinal()); 14 | json.put("source", message.getSource().ordinal()); 15 | json.put("timestamp", ISO8601Format.format(message.getTimestamp().getTime())); 16 | return json; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/data/FieldTypeFlutter.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.data; 2 | 3 | public enum FieldTypeFlutter { 4 | UNKNOWN(0), 5 | INTEGER(1), 6 | DOUBLE(2), 7 | DATE(3), 8 | TEXT(4), 9 | NULLABLE(5), 10 | BLOB(6), 11 | GEOMETRY(7); 12 | 13 | private final int value; 14 | 15 | FieldTypeFlutter(int value) { 16 | this.value = value; 17 | } 18 | 19 | public int getValue() { 20 | return value; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/data/GeodatabaseNativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.data; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import com.esri.arcgisruntime.data.Geodatabase; 7 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeObject; 8 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeHandler; 9 | import com.valentingrigorean.arcgis_maps_flutter.loadable.LoadableNativeHandler; 10 | 11 | import io.flutter.plugin.common.MethodChannel; 12 | 13 | public class GeodatabaseNativeObject extends BaseNativeObject { 14 | 15 | public GeodatabaseNativeObject(String objectId, Geodatabase geodatabase) { 16 | super(objectId, geodatabase, new NativeHandler[]{ 17 | new LoadableNativeHandler(geodatabase) 18 | }); 19 | } 20 | 21 | @Override 22 | public void onMethodCall(@NonNull String method, @Nullable Object args, @NonNull MethodChannel.Result result) { 23 | switch (method) { 24 | case "geodatabase#close": 25 | getNativeObject().close(); 26 | result.success(null); 27 | break; 28 | default: 29 | super.onMethodCall(method, args, result); 30 | break; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/ArcgisNativeObjectFactory.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | public interface ArcgisNativeObjectFactory { 7 | @NonNull 8 | NativeObject createNativeObject(@NonNull String objectId, @NonNull String type, @Nullable Object arguments, @NonNull NativeMessageSink messageSink); 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/BaseNativeHandler.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | public abstract class BaseNativeHandler implements NativeHandler { 7 | 8 | private final T nativeHandler; 9 | private boolean isDisposed = false; 10 | private NativeMessageSink messageSink; 11 | 12 | protected BaseNativeHandler(T nativeHandler) { 13 | this.nativeHandler = nativeHandler; 14 | } 15 | 16 | public T getNativeHandler() { 17 | return nativeHandler; 18 | } 19 | 20 | @Override 21 | public final void dispose() { 22 | if (isDisposed) { 23 | return; 24 | } 25 | isDisposed = true; 26 | disposeInternal(); 27 | } 28 | 29 | @Override 30 | public void setMessageSink(@Nullable NativeMessageSink messageSink) { 31 | this.messageSink = messageSink; 32 | } 33 | 34 | protected boolean isDisposed() { 35 | return isDisposed; 36 | } 37 | 38 | protected void disposeInternal() { 39 | 40 | } 41 | 42 | protected void sendMessage(@NonNull String method, @Nullable Object args) { 43 | if (messageSink != null && !isDisposed) { 44 | messageSink.send(method, args); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/NativeHandler.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import io.flutter.plugin.common.MethodChannel; 7 | 8 | public interface NativeHandler { 9 | void dispose(); 10 | 11 | void setMessageSink(@Nullable NativeMessageSink messageSink); 12 | 13 | boolean onMethodCall(@NonNull String method, @Nullable Object args, @NonNull MethodChannel.Result result); 14 | } 15 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/NativeMessageSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | public interface NativeMessageSink { 7 | void send(@NonNull String method, @Nullable Object args); 8 | } 9 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/NativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import io.flutter.plugin.common.MethodChannel; 7 | 8 | public interface NativeObject { 9 | String getObjectId(); 10 | 11 | void dispose(); 12 | 13 | void setMessageSink(@Nullable NativeMessageSink messageSink); 14 | 15 | void onMethodCall(@NonNull String method, @Nullable Object args, @NonNull MethodChannel.Result result); 16 | } 17 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/flutterobject/NativeObjectMessageSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.flutterobject; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import java.util.HashMap; 7 | 8 | public class NativeObjectMessageSink implements NativeMessageSink { 9 | private final String objectId; 10 | private final NativeMessageSink messageSink; 11 | private final HashMap data = new HashMap<>(3); 12 | 13 | 14 | public NativeObjectMessageSink(String objectId, NativeMessageSink messageSink) { 15 | this.objectId = objectId; 16 | this.messageSink = messageSink; 17 | } 18 | 19 | @Override 20 | public void send(@NonNull String method, @Nullable Object args) { 21 | data.clear(); 22 | data.put("objectId", objectId); 23 | data.put("method", method); 24 | data.put("arguments", args); 25 | messageSink.send("messageNativeObject", data); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/io/ApiKeyResourceNativeHandler.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.io; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import com.esri.arcgisruntime.ApiKeyResource; 7 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeHandler; 8 | 9 | import io.flutter.plugin.common.MethodChannel; 10 | 11 | public class ApiKeyResourceNativeHandler extends BaseNativeHandler { 12 | 13 | public ApiKeyResourceNativeHandler(ApiKeyResource apiKeyResource) { 14 | super(apiKeyResource); 15 | } 16 | 17 | @Override 18 | public boolean onMethodCall(@NonNull String method, @Nullable Object args, @NonNull MethodChannel.Result result) { 19 | switch (method) { 20 | case "apiKeyResource#getApiKey": 21 | result.success(getNativeHandler().getApiKey()); 22 | return true; 23 | case "apiKeyResource#setApiKey": 24 | getNativeHandler().setApiKey((String) args); 25 | result.success(null); 26 | return true; 27 | default: 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/layers/MapChangeAware.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.layers; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | import com.esri.arcgisruntime.mapping.ArcGISMap; 6 | 7 | public interface MapChangeAware { 8 | void onMapChange(@Nullable ArcGISMap map); 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/ArcgisMapFactory.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import android.content.Context; 4 | 5 | import com.valentingrigorean.arcgis_maps_flutter.LifecycleProvider; 6 | 7 | import java.util.Map; 8 | 9 | import io.flutter.plugin.common.BinaryMessenger; 10 | import io.flutter.plugin.common.StandardMessageCodec; 11 | import io.flutter.plugin.platform.PlatformView; 12 | import io.flutter.plugin.platform.PlatformViewFactory; 13 | 14 | 15 | public class ArcgisMapFactory extends PlatformViewFactory { 16 | 17 | private final BinaryMessenger binaryMessenger; 18 | private final LifecycleProvider lifecycleProvider; 19 | 20 | public ArcgisMapFactory(BinaryMessenger binaryMessenger, LifecycleProvider lifecycleProvider) { 21 | super(StandardMessageCodec.INSTANCE); 22 | this.binaryMessenger = binaryMessenger; 23 | this.lifecycleProvider = lifecycleProvider; 24 | } 25 | 26 | @Override 27 | public PlatformView create(Context context, int viewId, Object args) { 28 | Map params = (Map) args; 29 | return new ArcgisMapController(viewId, context, params, binaryMessenger, lifecycleProvider); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/BitmapDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | 4 | import com.esri.arcgisruntime.symbology.Symbol; 5 | 6 | public interface BitmapDescriptor { 7 | 8 | 9 | interface BitmapDescriptorListener { 10 | void onLoaded(Symbol symbol); 11 | 12 | void onFailed(); 13 | } 14 | 15 | void createSymbolAsync(BitmapDescriptorListener loader); 16 | } 17 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/GraphicControllerSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import android.graphics.Color; 4 | 5 | import com.esri.arcgisruntime.geometry.Geometry; 6 | import com.esri.arcgisruntime.mapping.view.GraphicsOverlay; 7 | 8 | public interface GraphicControllerSink { 9 | void add(GraphicsOverlay graphicsOverlay); 10 | 11 | void remove(GraphicsOverlay graphicsOverlay); 12 | 13 | boolean getVisible(); 14 | 15 | void setVisible(boolean visible); 16 | 17 | void setZIndex(int zIndex); 18 | 19 | void setGeometry(Geometry geometry); 20 | 21 | boolean isSelected(); 22 | 23 | void setSelected(boolean selected); 24 | 25 | boolean canConsumeTapEvents(); 26 | 27 | void setConsumeTapEvents(boolean consumeTapEvent); 28 | 29 | void setSelectedColor(Color color); 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/MapTouchGraphicDelegate.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import com.esri.arcgisruntime.mapping.view.Graphic; 4 | 5 | public interface MapTouchGraphicDelegate { 6 | boolean canConsumeTaps(); 7 | 8 | boolean didHandleGraphic(Graphic graphic); 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/MarkerControllerSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | public interface MarkerControllerSink extends GraphicControllerSink { 4 | void setSelectedScale(float selectedScale); 5 | 6 | void setIcon(BitmapDescriptor bitmapDescriptor); 7 | 8 | void setBackground(BitmapDescriptor bitmapDescriptor); 9 | 10 | void setIconOffset(float offsetX,float offsetY); 11 | 12 | void setOpacity(float opacity); 13 | 14 | void setAngle(float angle); 15 | } 16 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/PolygonControllerSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import com.esri.arcgisruntime.symbology.SimpleLineSymbol; 4 | 5 | public interface PolygonControllerSink extends GraphicControllerSink { 6 | 7 | void setFillColor(int color); 8 | 9 | void setStrokeColor(int color); 10 | 11 | void setStrokeWidth(float width); 12 | 13 | void setStrokeStyle(SimpleLineSymbol.Style style); 14 | } 15 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/PolylineController.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import android.graphics.Color; 4 | 5 | import com.esri.arcgisruntime.mapping.view.Graphic; 6 | import com.esri.arcgisruntime.symbology.SimpleLineSymbol; 7 | 8 | public final class PolylineController extends BaseGraphicController implements PolylineControllerSink { 9 | private final Graphic graphic; 10 | private final SimpleLineSymbol polylineSymbol; 11 | 12 | public PolylineController(String polylineId) { 13 | polylineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.BLACK, 10); 14 | graphic = new Graphic(); 15 | graphic.setSymbol(polylineSymbol); 16 | graphic.getAttributes().put("polylineId", polylineId); 17 | } 18 | 19 | @Override 20 | protected Graphic getGraphic() { 21 | return graphic; 22 | } 23 | 24 | public void setColor(int color) { 25 | polylineSymbol.setColor(color); 26 | } 27 | 28 | public void setWidth(float width) { 29 | polylineSymbol.setWidth(width); 30 | } 31 | 32 | public void setStyle(SimpleLineSymbol.Style style) { 33 | polylineSymbol.setStyle(style); 34 | } 35 | 36 | public void setAntialias(boolean antialias) { 37 | polylineSymbol.setAntiAlias(antialias); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/PolylineControllerSink.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import com.esri.arcgisruntime.symbology.SimpleLineSymbol; 4 | 5 | public interface PolylineControllerSink extends GraphicControllerSink { 6 | void setColor(int color); 7 | 8 | void setWidth(float width); 9 | 10 | void setStyle(SimpleLineSymbol.Style style); 11 | 12 | void setAntialias(boolean antialias); 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/ScreenLocationData.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import android.graphics.Point; 4 | 5 | import com.esri.arcgisruntime.geometry.SpatialReference; 6 | 7 | 8 | public class ScreenLocationData { 9 | private final Point point; 10 | private final SpatialReference spatialReference; 11 | 12 | 13 | public ScreenLocationData(Point point, SpatialReference spatialReference) { 14 | this.point = point; 15 | this.spatialReference = spatialReference; 16 | } 17 | 18 | public Point getPoint() { 19 | return point; 20 | } 21 | 22 | public SpatialReference getSpatialReference() { 23 | return spatialReference; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/SelectionPropertiesHandler.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import android.graphics.Color; 4 | 5 | import com.esri.arcgisruntime.mapping.SelectionProperties; 6 | import com.esri.arcgisruntime.mapping.view.Graphic; 7 | 8 | public class SelectionPropertiesHandler { 9 | private final SelectionProperties selectionProperties; 10 | private final int defaultSelectedColor; 11 | 12 | public SelectionPropertiesHandler(SelectionProperties selectionProperties) { 13 | this.selectionProperties = selectionProperties; 14 | this.defaultSelectedColor = selectionProperties.getColor(); 15 | } 16 | 17 | public void setSelected(Graphic graphic, Color selectedColor) { 18 | if (selectedColor != null) { 19 | selectionProperties.setColor(selectedColor.toArgb()); 20 | } else { 21 | reset(); 22 | } 23 | graphic.setSelected(true); 24 | } 25 | 26 | public void clearSelection(Graphic graphic) { 27 | graphic.setSelected(false); 28 | reset(); 29 | } 30 | 31 | public void reset() { 32 | if (selectionProperties.getColor() == defaultSelectedColor) 33 | return; 34 | selectionProperties.setColor(defaultSelectedColor); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/SymbolVisibilityFilter.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | import java.util.Objects; 4 | 5 | public class SymbolVisibilityFilter { 6 | private final double minZoom; 7 | private final double maxZoom; 8 | 9 | public SymbolVisibilityFilter(double minZoom, double maxZoom) { 10 | this.minZoom = minZoom; 11 | this.maxZoom = maxZoom; 12 | } 13 | 14 | public double getMinZoom() { 15 | return minZoom; 16 | } 17 | 18 | public double getMaxZoom() { 19 | return maxZoom; 20 | } 21 | 22 | @Override 23 | public boolean equals(Object o) { 24 | if (this == o) return true; 25 | if (o == null || getClass() != o.getClass()) return false; 26 | SymbolVisibilityFilter that = (SymbolVisibilityFilter) o; 27 | return Double.compare(that.minZoom, minZoom) == 0 && Double.compare(that.maxZoom, maxZoom) == 0; 28 | } 29 | 30 | @Override 31 | public int hashCode() { 32 | return Objects.hash(minZoom, maxZoom); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/map/SymbolsController.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.map; 2 | 3 | public interface SymbolsController { 4 | SymbolVisibilityFilterController getSymbolVisibilityFilterController(); 5 | 6 | void setSymbolVisibilityFilterController(SymbolVisibilityFilterController symbolVisibilityFilterController); 7 | 8 | SelectionPropertiesHandler getSelectionPropertiesHandler(); 9 | 10 | void setSelectionPropertiesHandler(SelectionPropertiesHandler selectionPropertiesHandler); 11 | } 12 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/scene/ArcgisSceneViewFactory.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.scene; 2 | 3 | import android.content.Context; 4 | 5 | import com.valentingrigorean.arcgis_maps_flutter.LifecycleProvider; 6 | 7 | import java.util.Map; 8 | 9 | import io.flutter.plugin.common.BinaryMessenger; 10 | import io.flutter.plugin.common.StandardMessageCodec; 11 | import io.flutter.plugin.platform.PlatformView; 12 | import io.flutter.plugin.platform.PlatformViewFactory; 13 | 14 | public class ArcgisSceneViewFactory extends PlatformViewFactory { 15 | 16 | private final BinaryMessenger binaryMessenger; 17 | private final LifecycleProvider lifecycleProvider; 18 | 19 | public ArcgisSceneViewFactory(BinaryMessenger binaryMessenger, LifecycleProvider lifecycleProvider) { 20 | super(StandardMessageCodec.INSTANCE); 21 | this.binaryMessenger = binaryMessenger; 22 | this.lifecycleProvider = lifecycleProvider; 23 | } 24 | 25 | @Override 26 | public PlatformView create(Context context, int viewId, Object args) { 27 | Map params = (Map) args; 28 | return new ArcgisSceneController(viewId, context, params, binaryMessenger, lifecycleProvider); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/scene/SceneController.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.scene; 2 | 3 | import com.esri.arcgisruntime.mapping.ArcGISScene; 4 | import com.esri.arcgisruntime.mapping.Surface; 5 | import com.esri.arcgisruntime.mapping.view.SceneView; 6 | import com.valentingrigorean.arcgis_maps_flutter.Convert; 7 | 8 | public class SceneController { 9 | private SceneView sceneView; 10 | 11 | private ArcGISScene scene; 12 | 13 | private Surface surface; 14 | 15 | public void setSceneView(SceneView sceneView) { 16 | 17 | this.sceneView = sceneView; 18 | } 19 | 20 | public void setScene(Object json) { 21 | if (json == null) { 22 | return; 23 | } 24 | 25 | scene = Convert.toScene(json); 26 | if (surface != null) { 27 | scene.setBaseSurface(surface); 28 | } 29 | 30 | sceneView.setScene(scene); 31 | } 32 | 33 | public void setSurface(Object json) { 34 | if (json == null) { 35 | return; 36 | } 37 | surface = Convert.toSurface(json); 38 | if (scene != null) { 39 | scene.setBaseSurface(surface); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/tasks/geodatabase/GenerateGeodatabaseJobNativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.tasks.geodatabase; 2 | 3 | import com.esri.arcgisruntime.tasks.geodatabase.GenerateGeodatabaseJob; 4 | import com.valentingrigorean.arcgis_maps_flutter.concurrent.JobNativeHandler; 5 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.ArcgisNativeObjectsController; 6 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeObject; 7 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeHandler; 8 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeMessageSink; 9 | 10 | public class GenerateGeodatabaseJobNativeObject extends BaseNativeObject { 11 | 12 | public GenerateGeodatabaseJobNativeObject(String objectId, GenerateGeodatabaseJob job, NativeMessageSink messageSink) { 13 | super(objectId, job, new NativeHandler[]{ 14 | new JobNativeHandler(job, JobNativeHandler.JobType.GENERATE_GEODATABASE) 15 | }); 16 | setMessageSink(messageSink); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/tasks/offlinemap/GenerateOfflineMapJobNativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.tasks.offlinemap; 2 | 3 | import com.esri.arcgisruntime.tasks.offlinemap.GenerateOfflineMapJob; 4 | import com.valentingrigorean.arcgis_maps_flutter.concurrent.JobNativeHandler; 5 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeObject; 6 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeHandler; 7 | import com.valentingrigorean.arcgis_maps_flutter.io.RemoteResourceNativeHandler; 8 | 9 | public class GenerateOfflineMapJobNativeObject extends BaseNativeObject { 10 | 11 | public GenerateOfflineMapJobNativeObject(String jobId, GenerateOfflineMapJob job) { 12 | super(jobId, job, new NativeHandler[]{ 13 | new JobNativeHandler(job, JobNativeHandler.JobType.GENERATE_OFFLINE_MAP), 14 | new RemoteResourceNativeHandler(job), 15 | }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/tasks/tilecache/EstimateTileCacheSizeJobNativeObjectNativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.tasks.tilecache; 2 | 3 | import com.esri.arcgisruntime.tasks.tilecache.EstimateTileCacheSizeJob; 4 | import com.valentingrigorean.arcgis_maps_flutter.concurrent.JobNativeHandler; 5 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.ArcgisNativeObjectsController; 6 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeObject; 7 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeHandler; 8 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeMessageSink; 9 | import com.valentingrigorean.arcgis_maps_flutter.io.RemoteResourceNativeHandler; 10 | 11 | public class EstimateTileCacheSizeJobNativeObjectNativeObject extends BaseNativeObject { 12 | 13 | public EstimateTileCacheSizeJobNativeObjectNativeObject(String objectId, EstimateTileCacheSizeJob job, NativeMessageSink messageSink) { 14 | super(objectId, job, new NativeHandler[]{ 15 | new JobNativeHandler(job, JobNativeHandler.JobType.ESTIMATE_TILE_CACHE_SIZE), 16 | new RemoteResourceNativeHandler(job), 17 | }); 18 | setMessageSink(messageSink); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/tasks/tilecache/ExportTileCacheJobNativeObject.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.tasks.tilecache; 2 | 3 | import com.esri.arcgisruntime.tasks.tilecache.ExportTileCacheJob; 4 | import com.valentingrigorean.arcgis_maps_flutter.concurrent.JobNativeHandler; 5 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.ArcgisNativeObjectsController; 6 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.BaseNativeObject; 7 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeHandler; 8 | import com.valentingrigorean.arcgis_maps_flutter.flutterobject.NativeMessageSink; 9 | import com.valentingrigorean.arcgis_maps_flutter.io.RemoteResourceNativeHandler; 10 | 11 | public class ExportTileCacheJobNativeObject extends BaseNativeObject { 12 | 13 | public ExportTileCacheJobNativeObject(String objectId, ExportTileCacheJob job, NativeMessageSink messageSink) { 14 | super(objectId, job, new NativeHandler[]{ 15 | new JobNativeHandler(job, JobNativeHandler.JobType.EXPORT_TILE_CACHE), 16 | new RemoteResourceNativeHandler(job), 17 | }); 18 | setMessageSink(messageSink); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/toolkit/extension/ArcGISExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Esri 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.valentingrigorean.arcgis_maps_flutter.toolkit.extension 18 | 19 | import com.esri.arcgisruntime.UnitSystem 20 | 21 | /** 22 | * Return an instance of [UnitSystem] mapped by an int. Must be 0 for [UnitSystem.IMPERIAL] or 1 for [UnitSystem.METRIC]. 23 | * 24 | * @throws IllegalArgumentException if an int that is neither 0 or 1 is supplied. 25 | * @since 100.5.0 26 | */ 27 | internal fun unitSystemFromInt(value: Int): UnitSystem { 28 | return when (value) { 29 | 0 -> UnitSystem.IMPERIAL 30 | 1 -> UnitSystem.METRIC 31 | else -> throw IllegalArgumentException("No valid Integer supplied to return a UnitSystem.") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/toolkit/extension/ClassExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Esri 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.valentingrigorean.arcgis_maps_flutter.toolkit.extension 18 | 19 | /** 20 | * Extension property that provides a String representing a class name. To be used for Android Logs. 21 | * 22 | * @since 100.6.0 23 | */ 24 | val Any.logTag: String 25 | get() { 26 | (this::class.simpleName)?.let { 27 | return it 28 | } 29 | return "Unknown class" 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/toolkit/scalebar/Multiplier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Esri 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.valentingrigorean.arcgis_maps_flutter.toolkit.scalebar 18 | 19 | /** 20 | * Container for a "multiplier" and the array of segment options appropriate for that multiplier. The multiplier is 21 | * used when calculating the length of a scalebar or the number of segments in the scalebar. 22 | * 23 | * @property multiplier used when calculating the length of a scalebar or the number of segments in the scalebar 24 | * @property segmentOptions the array of segment options appropriate for the multiplier 25 | * @since 100.5.0 26 | */ 27 | internal class Multiplier(val multiplier: Double, val segmentOptions: IntArray) 28 | -------------------------------------------------------------------------------- /android/src/main/java/com/valentingrigorean/arcgis_maps_flutter/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter.utils; 2 | 3 | public class StringUtils { 4 | public static boolean areEqual(String s1, String s2) { 5 | if (s1 == null && s2 == null) 6 | return true; 7 | if (s1 == null || s2 == null) 8 | return false; 9 | return s1.equals(s2); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /android/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16sp 4 | -------------------------------------------------------------------------------- /assets/2.0x/ic_compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/assets/2.0x/ic_compass.png -------------------------------------------------------------------------------- /assets/3.0x/ic_compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/assets/3.0x/ic_compass.png -------------------------------------------------------------------------------- /assets/ic_compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/assets/ic_compass.png -------------------------------------------------------------------------------- /example/.env-sample: -------------------------------------------------------------------------------- 1 | username= 2 | password= 3 | apiKey= 4 | licenseKey= 5 | geodataCredentialsUsername= 6 | geodataCredentialsPassword= 7 | snla_maps_arcgis_username= 8 | snla_maps_arcgis_password= -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | *.env 35 | 36 | # Web related 37 | lib/generated_plugin_registrant.dart 38 | 39 | # Symbolication related 40 | app.*.symbols 41 | 42 | # Obfuscation related 43 | app.*.map.json 44 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # arcgis_maps_flutter_example 2 | 3 | Demonstrates how to use the arcgis_maps_flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/valentingrigorean/arcgis_maps_flutter_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.valentingrigorean.arcgis_maps_flutter_example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/ic_flight_hazard.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/ic_marker.xml: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | //ext.kotlin_version = '1.4.10' 3 | 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:7.4.2' 11 | //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | #android.enableR8=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/assets/Yellowstone.mmpk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/assets/Yellowstone.mmpk -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 13.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/ic_flight_hazard.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_flighthazard.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/ic_marker.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_poi.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/ic_marker.imageset/ic_poi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/ios/Runner/Assets.xcassets/ic_marker.imageset/ic_poi.pdf -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/map_page_group_layer.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class MapPageGroupLayer extends StatelessWidget { 5 | const MapPageGroupLayer({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text('Group Layer'), 12 | ), 13 | body: ArcgisMapView( 14 | map: ArcGISMap.openStreetMap(), 15 | operationalLayers: { 16 | GroupLayer( 17 | layerId: const LayerId('Group'), 18 | layers: { 19 | FeatureLayer.fromUrl( 20 | 'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0'), 21 | FeatureLayer.fromUrl( 22 | 'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails_Styled/FeatureServer/0'), 23 | FeatureLayer.fromUrl( 24 | 'https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space_Styled/FeatureServer/0'), 25 | }, 26 | ), 27 | }, 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /example/lib/map_page_max_extent.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class MapPageMaxExtent extends StatelessWidget { 6 | const MapPageMaxExtent({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Max Extent'), 13 | ), 14 | body: ArcgisMapView( 15 | map: ArcGISMap.fromPortalItem( 16 | PortalItem( 17 | portal: Portal.arcGISOnline( 18 | withLoginRequired: false, 19 | ), 20 | itemId: 'acc027394bc84c2fb04d1ed317aac674', 21 | ), 22 | ), 23 | onMapCreated: (controller) async { 24 | final extent = await controller.getMapMaxExtend(); 25 | if (kDebugMode) { 26 | print('Max extent: $extent'); 27 | } 28 | }, 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /example/lib/map_page_portal.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class MapPagePortal extends StatelessWidget { 5 | const MapPagePortal({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text('Portal'), 12 | ), 13 | body: ArcgisMapView( 14 | map: ArcGISMap.openStreetMap(), 15 | operationalLayers: { 16 | FeatureLayer.fromPortalItem( 17 | layerId: const LayerId('LayerId'), 18 | portalItem: PortalItem( 19 | portal: Portal.arcGISOnline(withLoginRequired: false), 20 | itemId: 'af1ad38816814b7eba3fe74a3b84412d', 21 | ), 22 | portalItemLayerId: 0, 23 | ) 24 | }, 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /example/lib/map_page_scrolling_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/gestures.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class MapPageScrollingList extends StatelessWidget { 7 | const MapPageScrollingList({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('Scrolling List'), 14 | ), 15 | body: ListView.builder( 16 | itemCount: 3, 17 | itemBuilder: (BuildContext context, int index) { 18 | return SizedBox( 19 | height: 300, 20 | child: ArcgisMapView( 21 | map: ArcGISMap.imageryWithLabels(), 22 | gestureRecognizers: { 23 | Factory( 24 | () => HorizontalDragGestureRecognizer(), 25 | ), 26 | }, 27 | ), 28 | ); 29 | }, 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/lib/map_page_view_insests.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class MapPageViewInsets extends StatefulWidget { 5 | const MapPageViewInsets({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _MapPageViewInsetsState(); 9 | } 10 | 11 | class _MapPageViewInsetsState extends State { 12 | late final ArcgisMapController _mapController; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | body: Stack( 18 | children: [ 19 | ArcgisMapView( 20 | map: ArcGISMap.imagery(), 21 | isAttributionTextVisible: false, 22 | insetsContentInsetFromSafeArea: false, 23 | contentInsets: const EdgeInsets.only(bottom: 200), 24 | onTap: (_,point) { 25 | _mapController.setViewpointCenter(point); 26 | }, 27 | onMapCreated: (controller) { 28 | _mapController = controller; 29 | }, 30 | ), 31 | Positioned( 32 | left: 0, 33 | bottom: 0, 34 | right: 0, 35 | child: Container( 36 | height: 200, 37 | color: Colors.amberAccent.withOpacity(0.3), 38 | ), 39 | ) 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/scene_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class ScenePage extends StatefulWidget { 5 | const ScenePage({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _ScenePageState(); 9 | } 10 | 11 | class _ScenePageState extends State { 12 | final ArcGISScene _scene = ArcGISScene.fromBasemap(Basemap.createImagery()); 13 | final Surface _surface = Surface( 14 | surfaceId: const SurfaceId("my_surface"), 15 | elevationSources: { 16 | const ArcGISTiledElevationSource( 17 | elevationSourceId: ElevationSourceId("my_elevation"), 18 | url: 19 | "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer") 20 | }, 21 | elevationExaggeration: 2.5); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar( 27 | title: const Text("Scene 3d"), 28 | ), 29 | body: ArcgisSceneView( 30 | scene: _scene, 31 | surface: _surface, 32 | initialCamera: Camera.fromPoint( 33 | AGSPoint( 34 | x: -118.794, 35 | y: 33.909, 36 | z: 5330.0, 37 | spatialReference: SpatialReference.wgs84()), 38 | 355.0, 39 | 72.0, 40 | 0), 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 4 | 5 | class Utils { 6 | static final Random _random = Random(); 7 | 8 | Utils._(); 9 | 10 | static AGSPoint getRandomLocation(AGSPoint point, int radius) { 11 | double x0 = point.latitude; 12 | double y0 = point.longitude; 13 | 14 | double radiusInDegrees = radius / 111000; 15 | 16 | double u = _random.nextDouble(); 17 | double v = _random.nextDouble(); 18 | double w = radiusInDegrees * sqrt(u); 19 | double t = 2 * pi * v; 20 | double x = w * cos(t); 21 | double y = w * sin(t) * 1.75; 22 | 23 | // Adjust the x-coordinate for the shrinking of the east-west distances 24 | double newX = x / sin(y0); 25 | 26 | double foundLatitude = newX + x0; 27 | double foundLongitude = y + y0; 28 | 29 | return AGSPoint.fromLatLng(latitude: foundLatitude, longitude: foundLongitude); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /example/lib/utils/credentials.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 3 | 4 | Credential snlaCredentials = UserCredential.createUserCredential( 5 | username: dotenv.env['snla_maps_arcgis_username'] ?? '', 6 | password: dotenv.env['snla_maps_arcgis_password'] ?? '', 7 | ); 8 | 9 | final geodataCredentials = UserCredential.createUserCredential( 10 | username: dotenv.env['username'] ?? '', 11 | password: dotenv.env['password'] ?? '', 12 | ); 13 | -------------------------------------------------------------------------------- /example/lib/utils/models.dart: -------------------------------------------------------------------------------- 1 | enum MapCreateType { 2 | tiled, 3 | vectorTiled, 4 | } 5 | 6 | enum MapType { 7 | standard, 8 | standardTerrain, 9 | grayTone, 10 | grayToneTerrain, 11 | raster, 12 | satelit, 13 | satelitWorld, 14 | } 15 | 16 | enum GeomapTransportType { 17 | bus, 18 | subway, 19 | tram, 20 | ferry, 21 | train, 22 | airports, 23 | chargingStation, 24 | tollStation, 25 | restArea, 26 | webcamAlongTheRoad, 27 | trafficVolume, 28 | trafficVolumeWithLabels, 29 | parkingSpace, 30 | chargePoint, 31 | aviationObstacleLine, 32 | aviationObstacleLinePoint, 33 | aviationObstaclesPoint, 34 | roadCenterLine 35 | } 36 | 37 | class MapTypeCreateParams { 38 | const MapTypeCreateParams({ 39 | required this.url, 40 | required this.createType, 41 | }); 42 | 43 | final String url; 44 | final MapCreateType createType; 45 | } 46 | 47 | class MapTypeOptions { 48 | final MapTypeCreateParams mapUrl; 49 | final MapTypeCreateParams? darkMapUrl; 50 | final MapType mapType; 51 | final bool? useDarkScaleBar; 52 | 53 | const MapTypeOptions({ 54 | required this.mapUrl, 55 | this.darkMapUrl, 56 | required this.mapType, 57 | this.useDarkScaleBar, 58 | }); 59 | } 60 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:arcgis_maps_flutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp( 17 | apiVersion: '0', 18 | )); 19 | 20 | // Verify that platform version is retrieved. 21 | expect( 22 | find.byWidgetPredicate( 23 | (Widget widget) => 24 | widget is Text && widget.data!.startsWith('Running on:'), 25 | ), 26 | findsOneWidget, 27 | ); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /generator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | flutter pub run build_runner build --delete-conflicting-outputs -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/valentingrigorean/arcgis_maps_flutter/fbab80e47b628f133167980c86c0c8723a3e4337/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/ArcgisMapsFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ArcgisMapsFlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/ArcgisMapsFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "ArcgisMapsFlutterPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "arcgis_maps_flutter-Swift.h" 9 | #endif 10 | 11 | @implementation ArcgisMapsFlutterPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftArcgisMapsFlutterPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSAttributeParameterValue+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSAttributeParameterValue { 9 | 10 | convenience init(data: Dictionary) { 11 | self.init() 12 | attributeName = data["attributeName"] as! String 13 | parameterName = data["parameterName"] as! String 14 | if let parameterValue = data["parameterValue"] as? Dictionary { 15 | self.parameterValue = fromFlutterField(data: parameterValue) 16 | } 17 | } 18 | 19 | func toJSONFlutter() -> Any { 20 | [ 21 | "attributeName": attributeName, 22 | "parameterName": parameterName, 23 | "parameterValue": toFlutterFieldType(obj: parameterValue) 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSCostAttribute+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSCostAttribute { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | if let parameterValues = parameterValues { 12 | json["parameterValues"] = parameterValues.toFlutterTypes() 13 | } 14 | json["unit"] = unit.rawValue 15 | return json 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSCredential+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 31.03.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSCredential { 9 | convenience init(data: Dictionary) { 10 | 11 | let type = data["type"] as! String 12 | 13 | switch type { 14 | case "UserCredential": 15 | let referer = data["referer"] as? String 16 | if let token = data["token"] as? String { 17 | self.init(token: token, referer: referer) 18 | return 19 | } 20 | let username = data["username"] as! String 21 | let password = data["password"] as! String 22 | self.init(user: username, password: password) 23 | break 24 | default: 25 | fatalError("Not implemented.") 26 | break 27 | } 28 | 29 | } 30 | 31 | func toJSONFlutter() -> Any { 32 | [ 33 | "type": "UserCredential", 34 | "username": username, 35 | "password": password, 36 | "referer": referer, 37 | "token": token 38 | ] 39 | } 40 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSDirectionEvent+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSDirectionEvent { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | if let estimatedArrivalTime = estimatedArrivalTime { 12 | json["estimatedArrivalTime"] = estimatedArrivalTime.toIso8601String() 13 | } 14 | json["estimatedArrivalTimeShift"] = estimatedArrivalTimeShift 15 | json["eventMessages"] = eventMessages 16 | json["eventText"] = eventText 17 | 18 | if let geometry = geometry { 19 | json["geometry"] = geometry.toJSONFlutter() 20 | } 21 | return json 22 | } 23 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSDirectionManeuver+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSDirectionManeuver { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | json["directionEvents"] = directionEvents.map { 12 | $0.toJSONFlutter() 13 | } 14 | json["directionText"] = directionText 15 | if let estimatedArriveTime = estimatedArriveTime { 16 | json["estimatedArriveTime"] = estimatedArriveTime.toIso8601String() 17 | } 18 | json["estimatedArrivalTimeShift"] = estimatedArrivalTimeShift 19 | json["maneuverMessages"] = maneuverMessages.map { 20 | $0.toJSONFlutter() 21 | } 22 | json["fromLevel"] = fromLevel 23 | if let geometry = geometry { 24 | json["geometry"] = geometry.toJSONFlutter() 25 | } 26 | json["maneuverType"] = maneuverType.rawValue 27 | json["toLevel"] = toLevel 28 | json["length"] = length 29 | json["duration"] = duration 30 | return json 31 | } 32 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSDirectionMessage+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSDirectionMessage { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "type": type.rawValue, 12 | "text": text, 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSEditResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSEditResult { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "completedWithErrors": completedWithErrors, 12 | "editOperation": editOperation.rawValue, 13 | "error": error?.toJSON(), 14 | "globalId": globalID, 15 | "objectId": objectID, 16 | ] 17 | } 18 | } 19 | 20 | extension AGSFeatureEditResult { 21 | func toJSONFlutterEx() -> Any { 22 | [ 23 | "completedWithErrors": completedWithErrors, 24 | "editOperation": editOperation.rawValue, 25 | "error": error?.toJSON(), 26 | "globalId": globalID, 27 | "objectId": objectID, 28 | "attachmentResults": attachmentResults.map { 29 | $0.toJSONFlutter() 30 | }, 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSEnvelope+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 14.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSEnvelope { 9 | convenience init(data: Dictionary) { 10 | let bbox = data["bbox"] as! [Any] 11 | 12 | let spatialReference = data["spatialReference"] as? Dictionary 13 | 14 | if (bbox.count == 4) { 15 | self.init(xMin: bbox[0] as! Double, yMin: bbox[1] as! Double, xMax: bbox[2] as! Double, yMax: bbox[3] as! Double, spatialReference: spatialReference == nil ? nil : AGSSpatialReference(data: spatialReference!)) 16 | return 17 | } 18 | 19 | fatalError("Not implemented") 20 | } 21 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSExportTileCacheParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 25.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSExportTileCacheParameters { 9 | convenience init(data: Dictionary) { 10 | self.init() 11 | if let geometry = data["geometry"] as? Dictionary { 12 | areaOfInterest = AGSGeometry.fromFlutter(data: geometry) 13 | } 14 | compressionQuality = data["compressionQuality"] as! Float 15 | levelIDs = (data["levelIds"] as! [Int]).map({ NSNumber(value: $0) }) 16 | } 17 | 18 | func toJSONFlutter() -> Any { 19 | var json = [String: Any]() 20 | if let areaOfInterest = areaOfInterest { 21 | json["areaOfInterest"] = areaOfInterest.toJSONFlutter() 22 | } 23 | json["compressionQuality"] = compressionQuality 24 | json["levelIds"] = levelIDs.map({ $0.intValue }) 25 | return json 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGenerateLayerOption+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 29.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGenerateLayerOption { 9 | convenience init(data: Dictionary) { 10 | self.init(layerID: data["layerId"] as! Int) 11 | includeRelated = data["includeRelated"] as! Bool 12 | queryOption = AGSGenerateLayerQueryOption(rawValue: data["queryOption"] as! Int)! 13 | useGeometry = data["useGeometry"] as! Bool 14 | whereClause = data["whereClause"] as! String 15 | } 16 | 17 | func toJSONFlutter() -> Any { 18 | var json = [String: Any]() 19 | json["layerId"] = layerID 20 | json["includeRelated"] = includeRelated 21 | json["queryOption"] = queryOption.rawValue 22 | json["useGeometry"] = useGeometry 23 | json["whereClause"] = whereClause 24 | return json 25 | } 26 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGeoElement+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 16.06.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeoElement { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | if let geometry = geometry { 12 | json["geometry"] = geometry.toJSONFlutter() 13 | } 14 | json["attributes"] = attributes.toFlutterTypes() 15 | return json 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGeocodeResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 09.11.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeocodeResult { 9 | func toJSONFlutter() -> Any { 10 | var data = [String: Any]() 11 | if let attributes = attributes { 12 | data["attributes"] = attributes.toFlutterTypes() 13 | } 14 | if let displayLocation = displayLocation { 15 | data["displayLocation"] = displayLocation.toJSONFlutter() 16 | } 17 | if let extent = extent { 18 | data["extent"] = extent.toJSONFlutter() 19 | } 20 | 21 | if let inputLocation = inputLocation { 22 | data["inputLocation"] = inputLocation.toJSONFlutter() 23 | } 24 | 25 | data["label"] = label 26 | 27 | if let routeLocation = routeLocation { 28 | data["routeLocation"] = routeLocation.toJSONFlutter() 29 | } 30 | 31 | data["score"] = score 32 | return data 33 | } 34 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGeodatabaseDeltaInfo+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeodatabaseDeltaInfo { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | 12 | if let downloadDeltaFileUrl = downloadDeltaFileURL { 13 | json["downloadDeltaFileUrl"] = downloadDeltaFileUrl.absoluteString 14 | } 15 | json["featureServiceUrl"] = featureServiceURL.absoluteString 16 | json["geodatabaseFileUrl"] = geodatabaseFileURL.absoluteString 17 | if let uploadDeltaFileUrl = uploadDeltaFileURL { 18 | json["uploadDeltaFileUrl"] = uploadDeltaFileUrl.absoluteString 19 | } 20 | 21 | return json 22 | } 23 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGeodesicSectorParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 29.10.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeodesicSectorParameters { 9 | convenience init(data: Dictionary) { 10 | let center = AGSPoint(data: data["center"] as! Dictionary) 11 | let semiAxis1Length = data["semiAxis1Length"] as! Double 12 | let semiAxis2Length = data["semiAxis2Length"] as! Double 13 | let startDirection = data["startDirection"] as! Double 14 | let sectorAngle = data["sectorAngle"] as! Double 15 | self.init(center: center, semiAxis1Length: semiAxis1Length, semiAxis2Length: semiAxis2Length, sectorAngle: startDirection, startDirection: sectorAngle) 16 | 17 | let linearUnitId = AGSLinearUnitID.fromFlutter(data["linearUnit"] as! Int) 18 | let angularUnitId = AGSAngularUnitID.fromFlutter(data["angularUnit"] as! Int) 19 | angularUnit = AGSAngularUnit(unitID: angularUnitId)! 20 | linearUnit = AGSLinearUnit(unitID: linearUnitId)! 21 | axisDirection = data["axisDirection"] as! Double 22 | if let maxSegmentLength = data["maxSegmentLength"] as? Double { 23 | self.maxSegmentLength = maxSegmentLength 24 | } 25 | geometryType = AGSGeometryType(rawValue: data["geometryType"] as! Int)! 26 | maxPointCount = data["maxPointCount"] as! Int 27 | } 28 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGeometry+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 08.11.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeometry { 9 | static func fromFlutter(data: Dictionary) -> AGSGeometry? { 10 | let geometryType = AGSGeometryType(rawValue: data["type"] as! Int)! 11 | switch (geometryType) { 12 | case .point: 13 | return AGSPoint(data: data) 14 | case .envelope: 15 | return AGSEnvelope(data: data) 16 | case .polyline, .polygon, .multipoint: 17 | do { 18 | let geometry = try AGSGeometry.fromJSON(data) 19 | return geometry as? AGSGeometry 20 | } catch let error { 21 | fatalError("\(error)") 22 | } 23 | case .unknown: 24 | return nil 25 | @unknown default: 26 | return nil 27 | } 28 | } 29 | 30 | func toJSONFlutter() -> Any? { 31 | do { 32 | let json = try toJSON() 33 | if var dict = json as? Dictionary { 34 | dict["type"] = geometryType.rawValue 35 | return dict 36 | } 37 | return json 38 | } catch let error { 39 | return nil 40 | } 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSGraphic+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 29.03.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGraphic { 9 | convenience init(data: Dictionary) { 10 | let markerId = data["markerId"] as! String 11 | self.init(geometry: nil, symbol: nil, attributes: ["markerId": markerId]) 12 | } 13 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSIdentifyLayerResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 16.06.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSIdentifyLayerResult { 9 | func toJSONFlutter() -> Any { 10 | let elements = geoElements.map { 11 | $0.toJSONFlutter() 12 | } 13 | return [ 14 | "layerName": layerContent.name, 15 | "elements": elements 16 | ] 17 | } 18 | } 19 | 20 | extension Array where Element == AGSIdentifyLayerResult { 21 | func toJSONFlutter() -> [Any] { 22 | self.map { 23 | $0.toJSONFlutter() 24 | } 25 | } 26 | 27 | 28 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSJobMessage+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 28.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSJobMessage { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "message": message, 12 | "severity": severity.rawValue, 13 | "source": source.rawValue, 14 | "timestamp": timestamp.toIso8601String() 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSLevelOfDetail+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 14.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSLevelOfDetail { 9 | convenience init(data: [Any]) { 10 | self.init(level: data[0] as! Int, resolution: data[1] as! Double, scale: data[2] as! Double) 11 | } 12 | 13 | func toJSONFlutter() -> Any { 14 | [level, resolution, scale] 15 | } 16 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSLocation+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 09.12.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSLocation { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "course": course, 12 | "horizontalAccuracy": horizontalAccuracy, 13 | "lastKnown": lastKnown, 14 | "position": position?.toJSONFlutter(), 15 | "velocity": velocity, 16 | "timestamp": timestamp.toIso8601String(), 17 | "verticalAccuracy": verticalAccuracy 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSOfflineMapItemInfo+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 22.06.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSOfflineMapItemInfo { 9 | convenience init(data: [String: Any]) { 10 | self.init() 11 | accessInformation = data["accessInformation"] as! String 12 | itemDescription = data["itemDescription"] as! String 13 | snippet = data["snippet"] as! String 14 | tags = data["tags"] as! [String] 15 | termsOfUse = data["termsOfUse"] as! String 16 | title = data["title"] as! String 17 | if let thumbnail = data["thumbnail"] as? FlutterStandardTypedData { 18 | self.thumbnail = UIImage(data: thumbnail.data) 19 | } 20 | } 21 | 22 | func toJSONFlutter() -> Any { 23 | var data = [ 24 | "accessInformation": accessInformation, 25 | "itemDescription": itemDescription, 26 | "snippet": snippet, 27 | "tags": tags, 28 | "termsOfUse": termsOfUse, 29 | "title": title, 30 | ] as [String: Any] 31 | 32 | if let thumbnail = thumbnail { 33 | if let bytes = thumbnail.pngData() { 34 | data["thumbnail"] = FlutterStandardTypedData(bytes: bytes) 35 | } 36 | } 37 | return data 38 | } 39 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSOfflineMapSyncParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSOfflineMapSyncParameters { 9 | convenience init(data: Dictionary) { 10 | self.init() 11 | keepGeodatabaseDeltas = data["keepGeodatabaseDeltas"] as! Bool 12 | preplannedScheduledUpdatesOption = AGSPreplannedScheduledUpdatesOption(rawValue: data["preplannedScheduledUpdatesOption"] as! Int)! 13 | rollbackOnFailure = data["rollbackOnFailure"] as! Bool 14 | syncDirection = AGSSyncDirection(rawValue: data["syncDirection"] as! Int)! 15 | } 16 | 17 | func toJSONFlutter() -> Any { 18 | [ 19 | "keepGeodatabaseDeltas": keepGeodatabaseDeltas, 20 | "preplannedScheduledUpdatesOption": preplannedScheduledUpdatesOption.rawValue, 21 | "rollbackOnFailure": rollbackOnFailure, 22 | "syncDirection": syncDirection.rawValue, 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSOfflineMapSyncResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | 9 | extension AGSOfflineMapSyncResult { 10 | func toJSONFlutter() -> Any { 11 | [ 12 | "hasErrors": hasErrors, 13 | "isMobileMapPackageReopenRequired": isMobileMapPackageReopenRequired, 14 | ] 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSOfflineMapUpdateCapabilities+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSOfflineMapUpdateCapabilities { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "supportsScheduledUpdatesForFeatures": supportsScheduledUpdatesForFeatures, 12 | "supportsSyncWithFeatureServices": supportsSyncWithFeatureServices, 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSOfflineMapUpdatesInfo+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSOfflineMapUpdatesInfo { 9 | func toJSONFlutter() -> [String: Any] { 10 | [ 11 | "downloadAvailability": downloadAvailability.rawValue, 12 | "isMobileMapPackageReopenRequired": isMobileMapPackageReopenRequired, 13 | "scheduledUpdatesDownloadSize": scheduledUpdatesDownloadSize, 14 | "uploadAvailability": uploadAvailability.rawValue, 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSPoint+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 24.03.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSPoint { 9 | convenience init(data: Dictionary) { 10 | let x = data["x"] as! Double 11 | let y = data["y"] as! Double 12 | 13 | let z = data["z"] as? Double 14 | let m = data["m"] as? Double 15 | 16 | let spatialReferenceData = data["spatialReference"] as? Dictionary 17 | 18 | let spatialReference = spatialReferenceData == nil ? nil : AGSSpatialReference(data: spatialReferenceData!) 19 | 20 | if z != nil && m != nil && spatialReference != nil { 21 | self.init(x: x, y: y, z: z!, m: m!, spatialReference: spatialReference) 22 | return 23 | } 24 | self.init(x: x, y: y, spatialReference: spatialReference) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSPortal+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 04.06.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSPortal { 9 | convenience init(data: Dictionary) { 10 | let postalUrl = data["postalUrl"] as! String 11 | let loginRequired = data["loginRequired"] as! Bool 12 | self.init(url: URL(string: postalUrl)!, loginRequired: loginRequired) 13 | if let rawCredentials = data["credential"] as? Dictionary { 14 | credential = AGSCredential(data: rawCredentials) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSPortalItem+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 04.06.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSPortalItem { 9 | convenience init(data: Dictionary) { 10 | let portal = AGSPortal(data: data["portal"] as! Dictionary) 11 | let itemId = data["itemId"] as! String 12 | self.init(portal: portal, itemID: itemId) 13 | } 14 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSRestrictionAttribute+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSRestrictionAttribute { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | json["restrictionUsageParameterName"] = restrictionUsageParameterName 12 | if let parameterValues = parameterValues { 13 | json["parameterValues"] = parameterValues.toFlutterTypes() 14 | } 15 | return json 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSReverseGeocodeParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 10.12.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSReverseGeocodeParameters{ 9 | convenience init(data:Dictionary){ 10 | self.init() 11 | if let resultAttributeNames = data["resultAttributeNames"] as? [String]{ 12 | self.resultAttributeNames = resultAttributeNames 13 | } 14 | if let featureTypes = data["featureTypes"] as? [String]{ 15 | self.featureTypes = featureTypes 16 | } 17 | forStorage = data["forStorage"] as! Bool 18 | maxDistance = data["maxDistance"] as! Double 19 | maxResults = data["maxResults"] as! Int 20 | if let outputSpatialReference = data["outputSpatialReference"] as? Dictionary{ 21 | self.outputSpatialReference = AGSSpatialReference(data: outputSpatialReference) 22 | } 23 | outputLanguageCode = data["outputLanguageCode"] as! String 24 | } 25 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSRoute+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSRoute { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | json["directionManeuvers"] = directionManeuvers.map { 12 | $0.toJSONFlutter() 13 | } 14 | if let startTime = startTime { 15 | json["startTime"] = startTime.toIso8601String() 16 | } 17 | json["startTimeShift"] = startTimeShift 18 | if let endTime = endTime { 19 | json["endTime"] = endTime.toIso8601String() 20 | } 21 | json["endTimeShift"] = endTimeShift 22 | json["totalLength"] = totalLength 23 | if let routeGeometry = routeGeometry { 24 | json["routeGeometry"] = routeGeometry.toJSONFlutter() 25 | } 26 | json["stops"] = stops.map { 27 | $0.toJSONFlutter() 28 | } 29 | json["routeName"] = routeName 30 | json["totalTime"] = totalTime 31 | json["travelTime"] = travelTime 32 | json["violationTime"] = violationTime 33 | json["waitTime"] = waitTime 34 | return json 35 | } 36 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSRouteResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 02.02.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSRouteResult { 9 | func toJSONFlutter() -> Any { 10 | var json = [String: Any]() 11 | json["directionsLanguage"] = directionsLanguage 12 | json["messages"] = messages 13 | json["routes"] = routes.map { $0.toJSONFlutter() } 14 | return json 15 | } 16 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSpatialReference+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 14.04.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSpatialReference { 9 | convenience init?(data: Dictionary) { 10 | if let wkId = data["wkid"] as? Int { 11 | self.init(wkid: wkId) 12 | return 13 | } 14 | if let wkText = data["wkText"] as? String { 15 | self.init(wkText: wkText) 16 | return 17 | } 18 | 19 | fatalError("Not implemented") 20 | } 21 | 22 | func toJSONFlutter() -> Any { 23 | [ 24 | "wkid": wkid, 25 | "wkText": wkText 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSuggestParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 10.12.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSuggestParameters{ 9 | convenience init(data:Dictionary){ 10 | self.init() 11 | if let categories = data["categories"] as? [String]{ 12 | self.categories = categories 13 | } 14 | countryCode = data["countryCode"] as! String 15 | maxResults = data["maxResults"] as! Int 16 | if let preferredSearchLocation = data["preferredSearchLocation"] as? Dictionary{ 17 | self.preferredSearchLocation = AGSPoint(data: preferredSearchLocation) 18 | } 19 | if let searchArea = data["searchArea"] as? Dictionary{ 20 | self.searchArea = AGSGeometry.fromFlutter(data: searchArea) 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSuggestResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 10.12.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSuggestResult { 9 | func toJSONFlutter(suggestResultId: String) -> Dictionary { 10 | var result = Dictionary() 11 | result["label"] = label 12 | result["isCollection"] = isCollection 13 | result["suggestResultId"] = suggestResultId 14 | return result 15 | } 16 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSyncGeodatabaseParameters+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSyncGeodatabaseParameters { 9 | convenience init(data: Dictionary) { 10 | self.init() 11 | keepGeodatabaseDeltas = data["keepGeodatabaseDeltas"] as! Bool 12 | geodatabaseSyncDirection = AGSSyncDirection(rawValue: data["geodatabaseSyncDirection"] as! Int)! 13 | layerOptions = (data["layerOptions"] as! [Dictionary]).map { 14 | AGSSyncLayerOption(data: $0) 15 | } 16 | rollbackOnFailure = data["rollbackOnFailure"] as! Bool 17 | } 18 | 19 | func toJSONFlutter() -> Any { 20 | [ 21 | "keepGeodatabaseDeltas": keepGeodatabaseDeltas, 22 | "geodatabaseSyncDirection": geodatabaseSyncDirection.rawValue, 23 | "layerOptions": layerOptions.map { 24 | $0.toJSONFlutter() 25 | }, 26 | "rollbackOnFailure": rollbackOnFailure, 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSyncLayerOption+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSyncLayerOption { 9 | 10 | convenience init(data:Dictionary){ 11 | self.init() 12 | layerID = data["layerId"] as! Int 13 | syncDirection = AGSSyncDirection(rawValue: data["syncDirection"] as! Int)! 14 | } 15 | 16 | func toJSONFlutter() -> [String: Any] { 17 | [ 18 | "layerId": layerID, 19 | "syncDirection": syncDirection.rawValue, 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSSyncLayerResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSSyncLayerResult { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "editResults": editResults.map { 12 | $0.toJSONFlutterEx() 13 | }, 14 | "layerId": layerID, 15 | "tableName": tableName, 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSTileCache+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSTileCache { 9 | convenience init(data: Dictionary) { 10 | let url = data["url"] as! String 11 | self.init(name: url) 12 | } 13 | 14 | static func createFlutter(data: Dictionary) -> AGSTileCache { 15 | if let nativeObjectId = data["nativeObjectId"] as? String { 16 | let nativeObject = NativeObjectStorage.shared.getNativeObject(objectId: nativeObjectId) as? BaseNativeObject 17 | if let nativeObject = nativeObject { 18 | return nativeObject.nativeObject 19 | } 20 | } 21 | return AGSTileCache(data: data) 22 | } 23 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSTileInfo+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 14.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSTileInfo { 9 | convenience init(data: Dictionary) { 10 | let dpi = data["dpi"] as! Int 11 | let imageFormat = data["imageFormat"] as! Int 12 | let levelOfDetails = (data["levelOfDetails"] as! [Any]).map { 13 | AGSLevelOfDetail(data: $0 as! [Any]) 14 | } 15 | 16 | let origin = AGSPoint(data: data["origin"] as! Dictionary) 17 | let spatialReference = AGSSpatialReference(data: data["spatialReference"] as! Dictionary)! 18 | let tileHeight = data["tileHeight"] as! Int 19 | let tileWidth = data["tileWidth"] as! Int 20 | 21 | self.init(dpi: dpi, format: AGSTileImageFormat(rawValue: imageFormat) ?? .unknown, levelsOfDetail: levelOfDetails, origin: origin, spatialReference: spatialReference, tileHeight: tileHeight, tileWidth: tileWidth) 22 | } 23 | 24 | func toJSONFlutter() -> Dictionary { 25 | [ 26 | "dpi": dpi, 27 | "imageFormat": format.rawValue, 28 | "levelOfDetails": levelsOfDetail.map { $0.toJSONFlutter() }, 29 | "origin": origin.toJSONFlutter(), 30 | "spatialReference": spatialReference.toJSONFlutter(), 31 | "tileHeight": tileHeight, 32 | "tileWidth": tileWidth 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSTimeAware+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 12.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSTimeAware { 9 | func toJSONFlutter(layerId: String? = nil) -> Any { 10 | var data = Dictionary() 11 | 12 | if let layerId = layerId { 13 | data["layerId"] = layerId 14 | } 15 | 16 | if let fullTimeExtent = fullTimeExtent { 17 | let fullTimeExtentData = fullTimeExtent.toJSONFlutter() 18 | 19 | if let fullTimeExtentData = fullTimeExtentData { 20 | data["fullTimeExtent"] = fullTimeExtentData 21 | } 22 | } 23 | 24 | data["supportsTimeFiltering"] = supportsTimeFiltering 25 | data["isTimeFilteringEnabled"] = isTimeFilteringEnabled 26 | 27 | if let timeOffset = timeOffset { 28 | data["timeOffset"] = timeOffset.toJSONFlutter() 29 | } 30 | 31 | if let timeInterval = timeInterval { 32 | data["timeInterval"] = timeInterval.toJSONFlutter() 33 | } 34 | 35 | return data 36 | } 37 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSTimeExtent+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 12.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSTimeExtent { 9 | convenience init(data: Dictionary) { 10 | let startTime: Date? 11 | let endTime: Date? 12 | 13 | if let startTimeStr = data["startTime"] as? String { 14 | startTime = startTimeStr.toDateFromIso8601() 15 | } else { 16 | startTime = nil 17 | } 18 | 19 | if let endTimeStr = data["endTime"] as? String { 20 | endTime = endTimeStr.toDateFromIso8601() 21 | } else { 22 | endTime = nil 23 | } 24 | 25 | self.init(startTime: startTime, endTime: endTime) 26 | } 27 | 28 | func toJSONFlutter() -> Any? { 29 | var data = Dictionary() 30 | if let startTime = startTime { 31 | data["startTime"] = startTime.toIso8601String() 32 | } 33 | if let endTime = endTime { 34 | data["endTime"] = endTime.toIso8601String() 35 | } 36 | 37 | return data.count == 0 ? nil : data 38 | } 39 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSTimeValue+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 12.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSTimeValue { 9 | 10 | convenience init(data: Dictionary) { 11 | let duration = data["duration"] as! Double 12 | let unit = data["unit"] as! Int 13 | 14 | self.init(duration: duration, unit: AGSTimeUnit.init(rawValue: unit - 1) ?? .unknown) 15 | } 16 | 17 | func toJSONFlutter() -> Any { 18 | [ 19 | "duration": duration, 20 | "unit": unit.rawValue 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/AGSViewpoint+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 24.03.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSViewpoint { 9 | convenience init(data: Dictionary) { 10 | let scale = data["scale"] as! Double 11 | let targetGeometry = data["targetGeometry"] as! Dictionary 12 | 13 | self.init(center: AGSPoint(data: targetGeometry), scale: scale) 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/ArcGISEnum+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 16.04.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension Int { 9 | 10 | func toAGSViewpointType() -> AGSViewpointType { 11 | switch self { 12 | case 0: 13 | return .centerAndScale 14 | case 1: 15 | return .boundingGeometry 16 | default: 17 | return .boundingGeometry 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/Classes/Convert/Attributes+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 09.11.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension Dictionary where Key == String, Value == Any { 8 | func toFlutterTypes() -> Dictionary { 9 | var flutterAttributes = [String: Any]() 10 | 11 | for attr in self { 12 | flutterAttributes[attr.key] = toFlutterFieldType(obj: attr.value) 13 | } 14 | return flutterAttributes 15 | } 16 | } 17 | 18 | extension NSMutableDictionary { 19 | func toFlutterTypes() -> Dictionary { 20 | var flutterAttributes = [String: Any]() 21 | 22 | for attr in self { 23 | flutterAttributes[attr.key as! String] = toFlutterFieldType(obj: attr.value) 24 | } 25 | return flutterAttributes 26 | } 27 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/CGPoint+JSON.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 08.11.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension CGPoint { 8 | func toJSONFlutter() -> Any { 9 | [x, y] 10 | } 11 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/Date.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 12.09.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | private let format: ISO8601DateFormatter = { 8 | let dateFormat = ISO8601DateFormatter() 9 | dateFormat.formatOptions = [.withInternetDateTime, .withFractionalSeconds] 10 | return dateFormat 11 | }() 12 | 13 | extension Date { 14 | func toIso8601String() -> String { 15 | format.string(from: self) 16 | } 17 | } 18 | 19 | extension NSDate { 20 | func toIso8601String() -> String { 21 | format.string(from: self as Date) 22 | } 23 | } 24 | 25 | extension String { 26 | func toDateFromIso8601() -> Date? { 27 | format.date(from: self) 28 | } 29 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/Error+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 31.03.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension Error { 8 | func toJSON() -> Dictionary { 9 | var dict = [String: Any]() 10 | dict["domain"] = 2 11 | if let nsError = self as NSError? { 12 | dict["code"] = nsError.code 13 | dict["errorMessage"] = nsError.localizedDescription 14 | dict["additionalMessage"] = nsError.localizedFailureReason 15 | } else { 16 | dict["code"] = -1 17 | dict["errorMessage"] = localizedDescription 18 | } 19 | return dict 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Classes/Convert/GeodeticDistanceResult+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 09.12.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | extension AGSGeodeticDistanceResult { 9 | func toJSONFlutter() -> Any { 10 | [ 11 | "distance": distance, 12 | "distanceUnitId": distanceUnit?.unitID.toFlutter() ?? AGSLinearUnitID.other.toFlutter(), 13 | "azimuth1": azimuth1, 14 | "azimuth2": azimuth2, 15 | "angularUnitId": azimuthUnit?.unitID.toFlutter() ?? AGSAngularUnitID.other.toFlutter(), 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/ScalebarAlignment+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 11.07.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension Int { 8 | 9 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/UIColor+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 30.03.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension UIColor { 8 | convenience init?(data: Any?) { 9 | guard let value = data as? CUnsignedLong else { 10 | return nil 11 | } 12 | self.init(red: CGFloat(Float(((value & 0xFF0000) >> 16)) / 255.0), 13 | green: CGFloat(Float(((value & 0xFF00) >> 8)) / 255.0), 14 | blue: CGFloat(Float(((value & 0xFF))) / 255.0), 15 | alpha: CGFloat(Float(((value & 0xFF000000) >> 24)) / 255.0)) 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Convert/UIImage+Flutter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 03.08.2022. 3 | // 4 | 5 | import Foundation 6 | 7 | extension UIImage { 8 | func toJSONFlutter() -> Any? { 9 | if let data = pngData() { 10 | return FlutterStandardTypedData(bytes: data) 11 | } 12 | return nil 13 | } 14 | } -------------------------------------------------------------------------------- /ios/Classes/Data/GeodatabaseNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class GeodatabaseNativeObject: BaseNativeObject { 9 | 10 | init(objectId: String, geodatabase: AGSGeodatabase, messageSink: NativeMessageSink) { 11 | super.init(objectId: objectId, nativeObject: geodatabase, nativeHandlers: [ 12 | LoadableNativeHandler(loadable: geodatabase) 13 | ], messageSink: messageSink) 14 | } 15 | 16 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) { 17 | switch (method) { 18 | case "geodatabase#close": 19 | nativeObject.close(); 20 | result(nil) 21 | break 22 | default: 23 | super.onMethodCall(method: method, arguments: arguments, result: result) 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ios/Classes/Data/TileCacheNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class TileCacheNativeObject: BaseNativeObject { 9 | 10 | init(objectId: String, tileCache: AGSTileCache, messageSink: NativeMessageSink) { 11 | super.init(objectId: objectId,nativeObject: tileCache, nativeHandlers: [ 12 | LoadableNativeHandler(loadable: tileCache) 13 | ], messageSink: messageSink) 14 | } 15 | 16 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) { 17 | switch (method) { 18 | case "tileCache#getAntialiasing": 19 | result(nativeObject.antialiasing) 20 | break 21 | case "tileCache#getCacheStorageFormat": 22 | result(nativeObject.cacheStorageFormat.rawValue) 23 | break 24 | case "tileCache#getTileInfo": 25 | result(nativeObject.tileInfo?.toJSONFlutter()) 26 | break 27 | case "tileCache#getFullExtent": 28 | result(nativeObject.fullExtent?.toJSONFlutter()) 29 | break 30 | default: 31 | super.onMethodCall(method: method, arguments: arguments, result: result) 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /ios/Classes/FlutterObject/NativeObjectStorage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.07.2022. 3 | // 4 | 5 | import Foundation 6 | 7 | class NativeObjectStorage { 8 | private var nativeObjects: [String: NativeObject] = [:] 9 | 10 | private init() { 11 | 12 | } 13 | 14 | static let shared = NativeObjectStorage() 15 | 16 | func addNativeObject(object: NativeObject) { 17 | nativeObjects[object.objectId] = object 18 | } 19 | 20 | func getNativeObject(objectId: String) -> NativeObject? { 21 | nativeObjects[objectId] 22 | } 23 | 24 | func removeNativeObject(objectId: String) -> Void { 25 | let object = nativeObjects.removeValue(forKey: objectId) 26 | object?.dispose() 27 | } 28 | 29 | func clearAll() { 30 | for (_, nativeObject) in nativeObjects { 31 | nativeObject.dispose() 32 | } 33 | nativeObjects.removeAll() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ios/Classes/IO/ApiKeyResourceNativeHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 25.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class ApiKeyResourceNativeHandler: BaseNativeHandler { 9 | 10 | init(apiKeyResource: AGSAPIKeyResource) { 11 | super.init(nativeHandler: apiKeyResource) 12 | } 13 | 14 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) -> Bool { 15 | switch (method) { 16 | case "apiKeyResource#getApiKey": 17 | result(nativeHandler.apiKey) 18 | return true 19 | case "apiKeyResource#setApiKey": 20 | if let apiKey = arguments as? String { 21 | nativeHandler.apiKey = apiKey 22 | } 23 | result(nil) 24 | return true 25 | default: 26 | return false 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /ios/Classes/IO/RemoteResourceNativeHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 25.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class RemoteResourceNativeHandler: BaseNativeHandler { 9 | 10 | init(remoteResource: AGSRemoteResource) { 11 | super.init(nativeHandler: remoteResource) 12 | } 13 | 14 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) -> Bool { 15 | switch (method) { 16 | case "remoteResource#getUrl": 17 | result(nativeHandler.url?.absoluteString) 18 | return true 19 | case "remoteResource#getCredential": 20 | result(nativeHandler.credential?.toJSONFlutter()) 21 | return true 22 | case "remoteResource#setCredential": 23 | if let credential = arguments as? Dictionary { 24 | nativeHandler.credential = AGSCredential(data: credential) 25 | } 26 | result(nil) 27 | return true 28 | default: 29 | return false 30 | } 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /ios/Classes/Layers/TimeAwareLayersController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 12.09.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class TimeAwareLayersController { 9 | 10 | func getTimeAwareLayerInfo(layers: NSMutableArray, 11 | result: @escaping FlutterResult) { 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /ios/Classes/Map/ArcgisMapFactory.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.03.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | public class ArcgisMapFactory: NSObject, FlutterPlatformViewFactory { 8 | 9 | private let registrar: FlutterPluginRegistrar 10 | 11 | public init(registrar: FlutterPluginRegistrar) { 12 | self.registrar = registrar 13 | super.init() 14 | } 15 | 16 | 17 | public func create(withFrame frame: CGRect, 18 | viewIdentifier viewId: Int64, 19 | arguments args: Any?) -> FlutterPlatformView { 20 | ArcgisMapController(withRegistrar: registrar, withFrame: frame, viewIdentifier: viewId, arguments: args) 21 | } 22 | 23 | public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { 24 | FlutterStandardMessageCodec(readerWriter: FlutterStandardReaderWriter()) 25 | } 26 | } -------------------------------------------------------------------------------- /ios/Classes/Map/MapGraphicTouchDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 29.03.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | protocol MapGraphicTouchDelegate { 9 | func canConsumeTaps() -> Bool 10 | 11 | func didHandleGraphic(graphic: AGSGraphic) -> Bool 12 | } 13 | -------------------------------------------------------------------------------- /ios/Classes/Map/PolygonController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 16.04.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class PolygonController : BaseGraphicController { 9 | private let polygonSymbol: AGSSimpleFillSymbol 10 | private let polygonStrokeSymbol: AGSSimpleLineSymbol 11 | 12 | 13 | init(polygonId: String) { 14 | polygonStrokeSymbol = AGSSimpleLineSymbol(style: .solid, color: UIColor.black, width: 10) 15 | polygonSymbol = AGSSimpleFillSymbol(style: .solid, color: UIColor.black, outline: polygonStrokeSymbol) 16 | super.init(graphics: AGSGraphic(geometry: nil, symbol: polygonSymbol, attributes: ["polygonId": polygonId])) 17 | } 18 | 19 | func setVisible(visible: Bool) { 20 | graphics.isVisible = visible 21 | } 22 | 23 | func setFillColor(fillColor: UIColor) { 24 | polygonSymbol.color = fillColor 25 | } 26 | 27 | func setStrokeColor(strokeColor: UIColor) { 28 | polygonStrokeSymbol.color = strokeColor 29 | } 30 | 31 | func setPoints(points: [AGSPoint]) { 32 | graphics.geometry = AGSPolygon(points: points) 33 | } 34 | 35 | func setStrokeWidth(width: CGFloat) { 36 | polygonStrokeSymbol.width = width 37 | } 38 | 39 | func setStrokeStyle(style: AGSSimpleLineSymbolStyle) { 40 | polygonStrokeSymbol.style = style 41 | } 42 | 43 | func setZIndex(zIndex: Int) { 44 | graphics.zIndex = zIndex 45 | } 46 | } -------------------------------------------------------------------------------- /ios/Classes/Map/PolylineController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 28.04.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class PolylineController: BaseGraphicController { 9 | private let polylineSymbol: AGSSimpleLineSymbol 10 | 11 | init(polylineId: String) { 12 | polylineSymbol = AGSSimpleLineSymbol(style: .solid, color: UIColor.black, width: 10) 13 | super.init(graphics: AGSGraphic(geometry: nil, symbol: polylineSymbol, attributes: ["polylineId": polylineId])) 14 | } 15 | 16 | func setVisible(visible: Bool) { 17 | graphics.isVisible = visible 18 | } 19 | 20 | func setColor(color: UIColor) { 21 | polylineSymbol.color = color 22 | } 23 | 24 | func setStyle(style: AGSSimpleLineSymbolStyle) { 25 | polylineSymbol.style = style 26 | } 27 | 28 | func setPoints(points: [AGSPoint]) { 29 | graphics.geometry = AGSPolyline(points: points) 30 | } 31 | 32 | func setWidth(width: CGFloat) { 33 | polylineSymbol.width = width 34 | } 35 | 36 | func setZIndex(zIndex: Int) { 37 | graphics.zIndex = zIndex 38 | } 39 | 40 | func setAntialias(antialias: Bool) { 41 | polylineSymbol.antialias = antialias 42 | } 43 | } -------------------------------------------------------------------------------- /ios/Classes/Map/SelectionPropertiesHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 27.06.2021. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class SelectionPropertiesHandler { 9 | private let selectionProperties: AGSSelectionProperties 10 | private let defaultSelectedColor: UIColor 11 | 12 | init(selectionProperties: AGSSelectionProperties) { 13 | self.selectionProperties = selectionProperties 14 | defaultSelectedColor = selectionProperties.color 15 | } 16 | 17 | func setGraphicSelected(graphic: AGSGraphic, 18 | selectedColor: UIColor?) { 19 | if let selectedColor = selectedColor { 20 | selectionProperties.color = selectedColor 21 | } else { 22 | reset() 23 | } 24 | graphic.isSelected = true 25 | } 26 | 27 | func clearGraphicsSelection(graphic: AGSGraphic) { 28 | graphic.isSelected = false 29 | reset() 30 | } 31 | 32 | func reset() { 33 | if selectionProperties.color == defaultSelectedColor { 34 | return 35 | } 36 | selectionProperties.color = defaultSelectedColor 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /ios/Classes/Map/SymbolsController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 08.09.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | protocol SymbolsController { 8 | var symbolVisibilityFilterController: SymbolVisibilityFilterController? { get set } 9 | 10 | var selectionPropertiesHandler: SelectionPropertiesHandler? { get set } 11 | } 12 | 13 | extension SymbolsController { 14 | func updateController(controller: BaseGraphicController, 15 | data: Dictionary) { 16 | if let consumeTapEvents = data["consumeTapEvents"] as? Bool { 17 | controller.consumeTapEvents = consumeTapEvents 18 | } 19 | 20 | if let visible = data["visible"] as? Bool { 21 | let visibilityFilter = data["visibilityFilter"] as? Dictionary 22 | let symbolVisibilityFilterController = symbolVisibilityFilterController 23 | if visibilityFilter != nil && symbolVisibilityFilterController != nil { 24 | symbolVisibilityFilterController?.addGraphicsController(graphicController: controller, visibilityFilter: SymbolVisibilityFilter(data: visibilityFilter!), initValue: visible) 25 | } else { 26 | controller.isVisible = visible 27 | } 28 | } 29 | 30 | if let zIndex = data["zIndex"] as? Int { 31 | controller.zIndex = zIndex 32 | } 33 | 34 | controller.selectedColor = UIColor(data: data["selectedColor"]) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ios/Classes/Tasks/Geodatabase/GenerateGeodatabaseJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 29.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class GenerateGeodatabaseJobNativeObject: BaseNativeObject { 9 | init(objectId: String, job: AGSGenerateGeodatabaseJob, messageSink: NativeMessageSink) { 10 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 11 | JobNativeHandler(job: job), 12 | RemoteResourceNativeHandler(remoteResource: job) 13 | ], messageSink: messageSink) 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Classes/Tasks/Geodatabase/SyncGeodatabaseJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class SyncGeodatabaseJobNativeObject: BaseNativeObject { 9 | init(objectId: String, job: AGSSyncGeodatabaseJob, messageSink: NativeMessageSink) { 10 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 11 | JobNativeHandler(job: job), 12 | RemoteResourceNativeHandler(remoteResource: job) 13 | ], messageSink: messageSink) 14 | } 15 | 16 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) { 17 | switch (method) { 18 | case "syncGeodatabaseJob#getGeodatabaseDeltaInfo": 19 | result(nativeObject.geodatabaseDeltaInfo?.toJSONFlutter()) 20 | break 21 | case "syncGeodatabaseJob#getResult": 22 | result(nativeObject.result?.map({$0.toJSONFlutter()})) 23 | break 24 | default: 25 | super.onMethodCall(method: method, arguments: arguments, result: result) 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /ios/Classes/Tasks/OfflineMap/AGSOfflineMapSyncJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 23.08.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class AGSOfflineMapSyncJobNativeObject: BaseNativeObject { 9 | init(objectId: String, job: AGSOfflineMapSyncJob, messageSink: NativeMessageSink) { 10 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 11 | JobNativeHandler(job: job), 12 | RemoteResourceNativeHandler(remoteResource: job) 13 | ], messageSink: messageSink) 14 | } 15 | 16 | override func onMethodCall(method: String, arguments: Any?, result: @escaping FlutterResult) { 17 | switch method { 18 | case "offlineMapSyncJob#getGeodatabaseDeltaInfos": 19 | result(nativeObject.geodatabaseDeltaInfos.map { 20 | $0.toJSONFlutter() 21 | }) 22 | break 23 | case "offlineMapSyncJob#getResult": 24 | if let res = nativeObject.result { 25 | result(res.toJSONFlutter()) 26 | } else { 27 | result(nil) 28 | } 29 | break 30 | default: 31 | super.onMethodCall(method: method, arguments: arguments, result: result) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios/Classes/Tasks/OfflineMap/GenerateOfflineMapJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 24.06.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class GenerateOfflineMapJobNativeObject: BaseNativeObject { 9 | init(objectId: String, job: AGSGenerateOfflineMapJob, messageSink: NativeMessageSink) { 10 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 11 | JobNativeHandler(job: job), 12 | RemoteResourceNativeHandler(remoteResource: job) 13 | ], messageSink: messageSink) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ios/Classes/Tasks/TileCache/EstimateTileCacheSizeJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 25.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class EstimateTileCacheSizeJobNativeObject: BaseNativeObject { 9 | 10 | init(objectId: String, job: AGSEstimateTileCacheSizeJob, messageSink: NativeMessageSink) { 11 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 12 | JobNativeHandler(job: job), 13 | RemoteResourceNativeHandler(remoteResource: job) 14 | ], messageSink: messageSink) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/Classes/Tasks/TileCache/ExportTileCacheJobNativeObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 26.07.2022. 3 | // 4 | 5 | import Foundation 6 | import ArcGIS 7 | 8 | class ExportTileCacheJobNativeObject: BaseNativeObject { 9 | 10 | init(objectId: String, job: AGSExportTileCacheJob, messageSink: NativeMessageSink) { 11 | super.init(objectId: objectId, nativeObject: job, nativeHandlers: [ 12 | JobNativeHandler(job: job), 13 | RemoteResourceNativeHandler(remoteResource: job) 14 | ], messageSink: messageSink) 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /ios/Classes/Utils/DispatchQueue+Ext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 19.01.2023. 3 | // 4 | 5 | import Foundation 6 | 7 | extension DispatchQueue { 8 | func dispatchMainIfNeeded(execute work: @escaping @convention(block) () -> Void) { 9 | guard self === DispatchQueue.main && Thread.isMainThread else { 10 | DispatchQueue.main.async(execute: work) 11 | return 12 | } 13 | work() 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Classes/Utils/NSNumber+Ext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 16.06.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | 8 | extension NSNumber { 9 | var type: CFNumberType { 10 | CFNumberGetType(self as CFNumber) 11 | } 12 | } -------------------------------------------------------------------------------- /ios/Classes/Utils/UIImage+UIColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Valentin Grigorean on 30.03.2021. 3 | // 4 | 5 | import Foundation 6 | 7 | extension UIImage { 8 | 9 | func colored(_ color: UIColor) -> UIImage { 10 | if #available(iOS 10.0, *) { 11 | let renderer = UIGraphicsImageRenderer(size: size) 12 | return renderer.image { context in 13 | color.setFill() 14 | self.draw(at: .zero) 15 | context.fill(CGRect(x: 0, y: 0, width: size.width, height: size.height), blendMode: .sourceAtop) 16 | } 17 | } else { 18 | // Fallback on earlier versions 19 | return self 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ios/arcgis_maps_flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint arcgis_maps_flutter.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'arcgis_maps_flutter' 7 | s.version = '0.0.1' 8 | s.summary = 'A new flutter plugin project.' 9 | s.description = <<-DESC 10 | A new flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '14.0' 19 | 20 | # Flutter.framework does not contain a i386 slice. 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 22 | s.swift_version = '5.0' 23 | 24 | s.dependency 'ArcGIS-Runtime-SDK-iOS', '~> 100.15.0' 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/src/arcgis_runtime_environment.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum LicenseStatus { 4 | invalid, 5 | expired, 6 | loginRequired, 7 | valid, 8 | } 9 | 10 | class ArcGISRuntimeEnvironment { 11 | ArcGISRuntimeEnvironment._(); 12 | 13 | static Future setApiKey(String apiKey) => 14 | ArcgisFlutterPlatform.instance.setApiKey(apiKey); 15 | 16 | static Future getApiKey() => 17 | ArcgisFlutterPlatform.instance.getApiKey(); 18 | 19 | static Future setLicense(String licenseKey) => 20 | ArcgisFlutterPlatform.instance.setLicense(licenseKey); 21 | 22 | static Future getAPIVersion() => 23 | ArcgisFlutterPlatform.instance.getApiVersion(); 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/arcgisservices/level_of_detail.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class LevelOfDetail { 5 | const LevelOfDetail({ 6 | required this.level, 7 | required this.resolution, 8 | required this.scale, 9 | }); 10 | 11 | factory LevelOfDetail.fromJson(Map json) { 12 | return LevelOfDetail( 13 | level: json['level'] as int, 14 | resolution: json['resolution'] as double, 15 | scale: json['scale'] as double, 16 | ); 17 | } 18 | 19 | final int level; 20 | final double resolution; 21 | final double scale; 22 | 23 | Object toJson() { 24 | return [level, resolution, scale]; 25 | } 26 | 27 | @override 28 | String toString() { 29 | return 'LevelOfDetail{level: $level, resolution: $resolution, scale: $scale}'; 30 | } 31 | 32 | @override 33 | bool operator ==(Object other) => 34 | identical(this, other) || 35 | other is LevelOfDetail && 36 | runtimeType == other.runtimeType && 37 | level == other.level && 38 | resolution == other.resolution && 39 | scale == other.scale; 40 | 41 | @override 42 | int get hashCode => level.hashCode ^ resolution.hashCode ^ scale.hashCode; 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/data/geodatabase.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class Geodatabase extends ArcgisNativeObject with Loadable { 4 | /// Initialize this object with the name of an 5 | /// existing geodatabase (.geodatabase file), excluding 6 | /// the “.geodatabase” extension, 7 | Geodatabase({ 8 | required this.path, 9 | }); 10 | 11 | final String path; 12 | 13 | @override 14 | String get type => 'Geodatabase'; 15 | 16 | Future close() async { 17 | await invokeMethod('geodatabase#close'); 18 | } 19 | 20 | @override 21 | @protected 22 | dynamic getCreateArguments() => path; 23 | 24 | Object toJson() { 25 | if(!isCreated){ 26 | throw Exception('Object is not created'); 27 | } 28 | return nativeObjectId; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/sync_model.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum SyncModel { 4 | /// The geodatabase is not sync enabled. 5 | none(0), 6 | 7 | /// ayers within a geodatabase cannot be synchronized independently, 8 | /// the whole geodatabase must be synced. The sync operation and sync 9 | /// direction applies to all the layers in the geodatabase. 10 | geodatabase(1), 11 | 12 | /// Layers within a geodatabase can be synchronized independently of one another. 13 | /// Any subset of the layers can be synchronized when running the sync operation. 14 | /// Also, each layer's sync direction can be set independently. 15 | layer(2); 16 | 17 | const SyncModel(this.value); 18 | 19 | factory SyncModel.fromValue(int value) { 20 | return SyncModel.values.firstWhere( 21 | (e) => e.value == value, 22 | orElse: () => SyncModel.none, 23 | ); 24 | } 25 | 26 | final int value; 27 | } -------------------------------------------------------------------------------- /lib/src/data/tile_key.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class TileKey { 5 | const TileKey({ 6 | required this.level, 7 | required this.column, 8 | required this.row, 9 | }); 10 | 11 | final int level; 12 | final int column; 13 | final int row; 14 | 15 | factory TileKey.fromJson(dynamic data) { 16 | if (data is Map) { 17 | return TileKey( 18 | level: data['level'] as int, 19 | column: data['column'] as int, 20 | row: data['row'] as int, 21 | ); 22 | } 23 | if (data is List) { 24 | return TileKey( 25 | level: data[0] as int, 26 | column: data[1] as int, 27 | row: data[2] as int, 28 | ); 29 | } 30 | throw ArgumentError('Not supported'); 31 | } 32 | 33 | Object toJson() { 34 | return [ 35 | level, 36 | column, 37 | row, 38 | ]; 39 | } 40 | 41 | @override 42 | String toString() { 43 | return 'TileKey{level: $level, column: $column, row: $row}'; 44 | } 45 | 46 | @override 47 | bool operator ==(Object other) => 48 | identical(this, other) || 49 | other is TileKey && 50 | runtimeType == other.runtimeType && 51 | level == other.level && 52 | column == other.column && 53 | row == other.row; 54 | 55 | @override 56 | int get hashCode => level.hashCode ^ column.hashCode ^ row.hashCode; 57 | } 58 | -------------------------------------------------------------------------------- /lib/src/dispose_scope.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class DisposeScope { 4 | final List _objects = []; 5 | bool _isDisposed = false; 6 | 7 | void add(ArcgisNativeObject object) { 8 | _checkIfDisposed(); 9 | _objects.add(object); 10 | } 11 | 12 | void addAll(Iterable objects) { 13 | _checkIfDisposed(); 14 | _objects.addAll(objects); 15 | } 16 | 17 | void dispose() { 18 | if (_isDisposed) { 19 | return; 20 | } 21 | _isDisposed = true; 22 | for (ArcgisNativeObject object in _objects) { 23 | object.dispose(); 24 | } 25 | } 26 | 27 | void _checkIfDisposed() { 28 | if (_isDisposed) { 29 | throw Exception('This object has been disposed.'); 30 | } 31 | } 32 | } 33 | 34 | extension DisposeScopeExtension on T { 35 | T disposeWith(DisposeScope scope) { 36 | scope.add(this); 37 | return this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/geometry/area_unit.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum AreaUnitId { 4 | acres, 5 | hectares, 6 | squareCentimeters, 7 | squareDecimeters, 8 | squareFeet, 9 | squareMeters, 10 | squareKilometers, 11 | squareMiles, 12 | squareMillimeters, 13 | squareYards, 14 | other 15 | } -------------------------------------------------------------------------------- /lib/src/geometry/coordinate_formatter.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum LatitudeLongitudeFormat { 4 | /// The geographical coordinates are represented in decimal degrees. 5 | decimalDegrees, 6 | 7 | /// The geographical coordinates are represented in degrees and decimal minutes. 8 | degreesDecimalMinutes, 9 | 10 | /// The geographical coordinates are represented in degrees and minutes and decimal seconds. 11 | degreesMinutesSeconds 12 | } 13 | 14 | class CoordinateFormatter { 15 | CoordinateFormatter._(); 16 | 17 | /// Returns a coordinate notation string in latitude-longitude format 18 | /// representing the given point's location. 19 | /// The latitude-longitude string will contain a space separating the latitude 20 | /// from the longitude value, and the characters 'N' or 'S', and 'E' and 'W', 21 | /// to indicate the hemisphere of each value. The string will also 22 | /// contain spaces separating the components (degrees, minutes, seconds) 23 | /// of each value. The precision of the output is controlled by both 24 | /// the [format] and [decimalPlaces] parameters. 25 | static Future latitudeLongitudeString({ 26 | required AGSPoint from, 27 | required LatitudeLongitudeFormat format, 28 | required int decimalPlaces, 29 | }) { 30 | return CoordinateFormatterFlutterPlatform.instance.latitudeLongitudeString( 31 | from: from, 32 | format: format, 33 | decimalPlaces: decimalPlaces, 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/geometry/geometry_type.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum GeometryType { 4 | unknown(-1), 5 | point(1), 6 | envelope(2), 7 | polyline(3), 8 | polygon(4), 9 | multipoint(5); 10 | 11 | const GeometryType(this.value); 12 | 13 | factory GeometryType.fromValue(dynamic value) { 14 | if (value is int) { 15 | return GeometryType.values.firstWhere( 16 | (e) => e.value == value, 17 | orElse: () => GeometryType.unknown, 18 | ); 19 | } 20 | if (value is String) { 21 | switch (value) { 22 | case 'point': 23 | return GeometryType.point; 24 | case 'envelope': 25 | return GeometryType.envelope; 26 | case 'polyline': 27 | return GeometryType.polyline; 28 | case 'polygon': 29 | return GeometryType.polygon; 30 | case 'multipoint': 31 | return GeometryType.multipoint; 32 | default: 33 | return GeometryType.unknown; 34 | } 35 | } 36 | 37 | return GeometryType.unknown; 38 | } 39 | 40 | final int value; 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/io/api_key_resource.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/src/arcgis_native_object.dart'; 2 | 3 | mixin ApiKeyResource on ArcgisNativeObject { 4 | Future get apiKey async { 5 | return await invokeMethod('apiKeyResource#getApiKey') ?? ''; 6 | } 7 | 8 | Future setApiKey(String apiKey) async { 9 | await invokeMethod('apiKeyResource#setApiKey', arguments: apiKey); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/io/remote_resource.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/arcgis_native_object.dart'; 3 | 4 | mixin RemoteResource on ArcgisNativeObject { 5 | Future get url async { 6 | return await invokeMethod('remoteResource#getUrl'); 7 | } 8 | 9 | Future get credential async { 10 | final result = await invokeMethod('remoteResource#getCredential'); 11 | if (result == null) { 12 | return null; 13 | } 14 | return Credential.fromJson(result); 15 | } 16 | 17 | Future setCredential(Credential? credential) async { 18 | await invokeMethod( 19 | 'remoteResource#setCredential', 20 | arguments: credential?.toJson(), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/io/request_configuration.dart: -------------------------------------------------------------------------------- 1 | class RequestConfiguration{ 2 | 3 | } -------------------------------------------------------------------------------- /lib/src/layers/feature_collection_layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class FeatureCollectionLayer{ 4 | 5 | } -------------------------------------------------------------------------------- /lib/src/layers/geodatabase_layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class GeodatabaseLayer extends Layer { 5 | const GeodatabaseLayer({ 6 | required LayerId layerId, 7 | required this.path, 8 | this.featureLayersIds, 9 | }) : super( 10 | layerId: layerId, 11 | isVisible: true, 12 | opacity: 1, 13 | ); 14 | 15 | final String path; 16 | 17 | /// A list of layers to be included 18 | /// [featureLayersIds] is null will include all layers in the geodatabase. 19 | final List? featureLayersIds; 20 | 21 | @override 22 | GeodatabaseLayer clone() { 23 | return GeodatabaseLayer( 24 | layerId: layerId, 25 | path: path, 26 | featureLayersIds: featureLayersIds, 27 | ); 28 | } 29 | 30 | @override 31 | Map toJson() { 32 | final json = super.toJson(); 33 | json["layerType"] = "GeodatabaseLayer"; 34 | json['url'] = path; 35 | if (featureLayersIds != null) { 36 | json['featureLayersIds'] = featureLayersIds!; 37 | } 38 | return json; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/layers/layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class LayerId extends MapsObjectId { 5 | const LayerId(String value) : super(value); 6 | } 7 | 8 | abstract class Layer extends MapsObject with EquatableMixin { 9 | const Layer({ 10 | required this.isVisible, 11 | required this.opacity, 12 | required this.layerId, 13 | }) : assert(opacity >= 0 && opacity <= 1.0); 14 | 15 | @override 16 | LayerId get mapsId => layerId; 17 | 18 | final bool isVisible; 19 | final double opacity; 20 | final LayerId layerId; 21 | 22 | @override 23 | Map toJson() { 24 | return { 25 | 'isVisible': isVisible, 26 | 'opacity': opacity, 27 | 'layerId': layerId.value, 28 | }; 29 | } 30 | 31 | @override 32 | bool? get stringify => true; 33 | 34 | @override 35 | // ignore: hash_and_equals 36 | int get hashCode => layerId.hashCode; 37 | 38 | @override 39 | List get props => [ 40 | isVisible, 41 | opacity, 42 | layerId, 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/layers/layer_updates.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/maps_object_updates.dart'; 3 | 4 | class LayerUpdates extends MapsObjectUpdates { 5 | LayerUpdates.from(Set previous, Set current, String objectName) 6 | : super.from(previous, current, objectName: objectName); 7 | } 8 | -------------------------------------------------------------------------------- /lib/src/layers/legend_info.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class LegendInfo { 5 | const LegendInfo({ 6 | required this.name, 7 | required this.symbolImage, 8 | }); 9 | 10 | final String name; 11 | final Uint8List? symbolImage; 12 | 13 | static LegendInfo? fromJson(Map? json) { 14 | if (json == null) { 15 | return null; 16 | } 17 | 18 | return LegendInfo( 19 | name: json['name'], 20 | symbolImage: json['symbolImage'], 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/layers/legend_info_result.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class LegendInfoResult { 5 | const LegendInfoResult({ 6 | required this.layerName, 7 | required this.results, 8 | }); 9 | 10 | final String layerName; 11 | final List results; 12 | 13 | static LegendInfoResult? fromJson(Map? json) { 14 | if (json == null) return null; 15 | var results = json['results'] as List; 16 | return LegendInfoResult( 17 | layerName: json['layerName'] as String, 18 | results: results.map((e) => LegendInfo.fromJson(e)!).toList(), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/layers/map_image_layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class MapImageLayer extends BaseTileLayer { 5 | MapImageLayer.fromUrl( 6 | String url, { 7 | LayerId? layerId, 8 | Credential? credential, 9 | bool isVisible = true, 10 | double opacity = 1, 11 | }) : super.fromUrl( 12 | isVisible: isVisible, 13 | opacity: opacity, 14 | layerId: layerId ?? LayerId(url), 15 | url: url, 16 | type: 'MapImageLayer', 17 | credential: credential, 18 | ); 19 | 20 | @override 21 | clone() { 22 | return copyWith(); 23 | } 24 | 25 | MapImageLayer copyWith({ 26 | bool? isVisibleParam, 27 | double? opacityParam, 28 | }) { 29 | return MapImageLayer.fromUrl( 30 | url!, 31 | layerId: layerId, 32 | credential: credential, 33 | isVisible: isVisibleParam ?? isVisible, 34 | opacity: opacityParam ?? opacity, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/src/layers/vector_tile_layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class VectorTileLayer extends BaseTileLayer { 5 | VectorTileLayer.fromUrl(String url,{ 6 | LayerId? layerId, 7 | Credential? credential, 8 | bool isVisible = true, 9 | double opacity = 1, 10 | }) : super.fromUrl( 11 | isVisible: isVisible, 12 | opacity: opacity, 13 | layerId: layerId ?? LayerId(url), 14 | url: url, 15 | type: 'VectorTileLayer', 16 | credential: credential, 17 | ); 18 | 19 | 20 | @override 21 | clone() { 22 | return copyWith(); 23 | } 24 | 25 | VectorTileLayer copyWith({ 26 | bool? isVisibleParam, 27 | double? opacityParam, 28 | }) { 29 | return VectorTileLayer.fromUrl( 30 | url!, 31 | layerId: layerId, 32 | credential: credential, 33 | isVisible: isVisibleParam ?? isVisible, 34 | opacity: opacityParam ?? opacity, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/src/layers/wms_layer.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class WmsLayer extends BaseTileLayer { 4 | WmsLayer.fromUrl( 5 | String url, { 6 | LayerId? layerId, 7 | required this.layersName, 8 | Credential? credential, 9 | bool isVisible = true, 10 | double opacity = 1, 11 | }) : super.fromUrl( 12 | isVisible: isVisible, 13 | opacity: opacity, 14 | layerId: layerId ?? LayerId(url), 15 | url: url, 16 | type: 'WmsLayer', 17 | credential: credential, 18 | ); 19 | 20 | final List layersName; 21 | 22 | @override 23 | Map toJson() { 24 | final Map json = super.toJson(); 25 | json['layersName'] = layersName; 26 | return json; 27 | } 28 | 29 | @override 30 | clone() { 31 | return copyWith(); 32 | } 33 | 34 | WmsLayer copyWith({ 35 | bool? isVisibleParam, 36 | double? opacityParam, 37 | }) { 38 | return WmsLayer.fromUrl( 39 | url!, 40 | layerId: layerId, 41 | credential: credential, 42 | layersName: layersName, 43 | isVisible: isVisibleParam ?? isVisible, 44 | opacity: opacityParam ?? opacity, 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/mapping/arcgis_tiled_elevation_source.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class ArcGISTiledElevationSource implements ElevationSource { 5 | const ArcGISTiledElevationSource( 6 | {required this.elevationSourceId, required this.url}); 7 | 8 | final ElevationSourceId elevationSourceId; 9 | 10 | final String url; 11 | 12 | @override 13 | clone() { 14 | return ArcGISTiledElevationSource( 15 | elevationSourceId: elevationSourceId, url: url); 16 | } 17 | 18 | @override 19 | MapsObjectId get mapsId => elevationSourceId; 20 | 21 | @override 22 | Object toJson() { 23 | final Map json = {}; 24 | 25 | void addIfPresent(String fieldName, Object? value) { 26 | if (value != null) { 27 | json[fieldName] = value; 28 | } 29 | } 30 | 31 | addIfPresent('elevationSourceId', elevationSourceId.value); 32 | addIfPresent('elevationType', 'ArcGISTiledElevationSource'); 33 | addIfPresent('url', url); 34 | 35 | return json; 36 | } 37 | 38 | @override 39 | bool operator ==(Object other) => 40 | identical(this, other) || 41 | other is ArcGISTiledElevationSource && 42 | runtimeType == other.runtimeType && 43 | elevationSourceId == other.elevationSourceId && 44 | url == other.url; 45 | 46 | @override 47 | int get hashCode => elevationSourceId.hashCode; 48 | } 49 | -------------------------------------------------------------------------------- /lib/src/mapping/basemap_type_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | @immutable 5 | class BasemapTypeOptions { 6 | final BasemapType basemapType; 7 | final double latitude; 8 | final double longitude; 9 | final int levelOfDetail; 10 | 11 | const BasemapTypeOptions({ 12 | required this.basemapType, 13 | required this.latitude, 14 | required this.longitude, 15 | required this.levelOfDetail, 16 | }); 17 | 18 | Object toJson() { 19 | final Map json = {}; 20 | json['basemapType'] = 21 | basemapType.toString().replaceFirst('BasemapType.', ''); 22 | json['latitude'] = latitude; 23 | json['longitude'] = longitude; 24 | json['levelOfDetail'] = levelOfDetail; 25 | return json; 26 | } 27 | 28 | @override 29 | bool operator ==(Object other) => 30 | identical(this, other) || 31 | other is BasemapTypeOptions && 32 | runtimeType == other.runtimeType && 33 | basemapType == other.basemapType && 34 | latitude == other.latitude && 35 | longitude == other.longitude && 36 | levelOfDetail == other.levelOfDetail; 37 | 38 | @override 39 | int get hashCode => 40 | basemapType.hashCode ^ 41 | latitude.hashCode ^ 42 | longitude.hashCode ^ 43 | levelOfDetail.hashCode; 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/mapping/elevation_source.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class ElevationSourceId extends MapsObjectId { 5 | const ElevationSourceId(String value) : super(value); 6 | } 7 | 8 | abstract class ElevationSource implements MapsObject { 9 | @override 10 | clone() { 11 | throw UnimplementedError(); 12 | } 13 | 14 | @override 15 | MapsObjectId get mapsId => throw UnimplementedError(); 16 | 17 | @override 18 | Object toJson() { 19 | throw UnimplementedError(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/mapping/geo_element.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | abstract class GeoElement { 5 | /// Attribute types supported are null, String, Date, and Numbers. 6 | /// Other attribute types will be ignored. 7 | Map get attributes; 8 | 9 | Geometry? get geometry; 10 | 11 | factory GeoElement.fromJson(Map json) { 12 | final Map attributes = parseAttributes(json['attributes']) ?? {}; 13 | 14 | Geometry? geometry; 15 | 16 | geometry = Geometry.fromJson(json['geometry']); 17 | 18 | return _GeoElementImpl(attributes, geometry); 19 | } 20 | 21 | GeoElement copyWith({ 22 | Map? attributesParam, 23 | Geometry? geometryParam, 24 | }); 25 | } 26 | 27 | class _GeoElementImpl implements GeoElement { 28 | final Map _attributes; 29 | final Geometry? _geometry; 30 | 31 | _GeoElementImpl(this._attributes, this._geometry); 32 | 33 | @override 34 | Map get attributes => _attributes; 35 | 36 | @override 37 | Geometry? get geometry => _geometry; 38 | 39 | @override 40 | GeoElement copyWith({ 41 | Map? attributesParam, 42 | Geometry? geometryParam, 43 | }) { 44 | return _GeoElementImpl( 45 | attributesParam ?? _attributes, 46 | geometryParam ?? _geometry, 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/src/mapping/mobile_map_package.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | abstract class MobileMapPackage { 4 | const MobileMapPackage({ 5 | required this.path, 6 | }); 7 | 8 | final String path; 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/mapping/view/identify_layer_result.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class IdentifyLayerResult { 5 | const IdentifyLayerResult({ 6 | required this.layerName, 7 | required this.elements, 8 | }); 9 | 10 | final String layerName; 11 | 12 | final List elements; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/mapping/view/layers_changed_listener.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum LayerType { 4 | operational, 5 | base, 6 | reference, 7 | } 8 | 9 | enum LayerChangeType { 10 | added, 11 | removed, 12 | unknown, 13 | } 14 | 15 | abstract class LayersChangedListener { 16 | void onLayersChanged( 17 | LayerType onLayer, 18 | LayerChangeType layerChange, 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/mapping/view/scene/arcgis_scene_controller.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | // ignore_for_file: library_private_types_in_public_api 4 | class ArcgisSceneController { 5 | // ignore: unused_field 6 | final _ArcgisSceneViewState _arcgisSceneViewState; 7 | final int sceneId; 8 | 9 | ArcgisSceneController._(this._arcgisSceneViewState, this.sceneId); 10 | 11 | static Future init( 12 | int id, _ArcgisSceneViewState arcgisSceneViewState) async { 13 | await ArcgisMapsFlutterPlatform.instance.init(id); 14 | return ArcgisSceneController._(arcgisSceneViewState, id); 15 | } 16 | 17 | Future setScene(ArcGISScene scene) { 18 | return ArcgisSceneFlutterPlatform.instance.setScene(sceneId, scene); 19 | } 20 | 21 | Future setSurface(Surface surface) { 22 | return ArcgisSceneFlutterPlatform.instance.setSurface(sceneId, surface); 23 | } 24 | 25 | Future setViewpointCamera(Camera camera) { 26 | return ArcgisSceneFlutterPlatform.instance 27 | .setViewpointCamera(sceneId, camera); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/mapping/view/time_extent_changed_listener.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | 4 | abstract class TimeExtentChangedListener{ 5 | void timeExtentChanged(TimeExtent? timeExtent); 6 | } -------------------------------------------------------------------------------- /lib/src/mapping/view/viewpoint_changed_listener.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | abstract class ViewpointChangedListener{ 4 | void viewpointChanged(); 5 | } -------------------------------------------------------------------------------- /lib/src/mapping/viewpoint_type.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum ViewpointType { 4 | /// A center point and scale. 5 | centerAndScale, 6 | /// A visible area. 7 | boundingGeometry, 8 | unknown, 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/maps_object.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart' show immutable, objectRuntimeType; 2 | 3 | /// Uniquely identifies object an among [GoogleMap] collections of a specific 4 | /// type. 5 | /// 6 | /// This does not have to be globally unique, only unique among the collection. 7 | @immutable 8 | class MapsObjectId { 9 | /// Creates an immutable object representing a [T] among [GoogleMap] Ts. 10 | /// 11 | /// An [AssertionError] will be thrown if [value] is null. 12 | const MapsObjectId(this.value); 13 | 14 | /// The value of the id. 15 | final String value; 16 | 17 | @override 18 | bool operator ==(Object other) { 19 | if (identical(this, other)) return true; 20 | if (other.runtimeType != runtimeType) return false; 21 | // ignore: test_types_in_equals 22 | final MapsObjectId typedOther = other as MapsObjectId; 23 | return value == typedOther.value; 24 | } 25 | 26 | @override 27 | int get hashCode => value.hashCode; 28 | 29 | @override 30 | String toString() { 31 | return '${objectRuntimeType(this, 'MapsObjectId')}($value)'; 32 | } 33 | } 34 | 35 | /// A common interface for maps types. 36 | abstract class MapsObject { 37 | const MapsObject(); 38 | 39 | /// A identifier for this object. 40 | MapsObjectId get mapsId; 41 | 42 | /// Returns a duplicate of this object. 43 | T clone(); 44 | 45 | /// Converts this object to something serializable in JSON. 46 | Object toJson(); 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/method_channel/arcgis_flutter_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/method_channel/method_channel_arcgis_flutter.dart'; 3 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 4 | 5 | abstract class ArcgisFlutterPlatform extends PlatformInterface { 6 | static final Object _token = Object(); 7 | 8 | static ArcgisFlutterPlatform _instance = MethodChannelArcgisFlutter(); 9 | 10 | ArcgisFlutterPlatform() : super(token: _token); 11 | 12 | static ArcgisFlutterPlatform get instance => _instance; 13 | 14 | /// Platform-specific plugins should set this with their own platform-specific 15 | /// class that extends [UrlLauncherPlatform] when they register themselves. 16 | static set instance(ArcgisFlutterPlatform instance) { 17 | PlatformInterface.verifyToken(instance, _token); 18 | _instance = instance; 19 | } 20 | 21 | Future setApiKey(String apiKey) { 22 | throw UnimplementedError('setApiKey() has not been implemented.'); 23 | } 24 | 25 | Future getApiKey() { 26 | throw UnimplementedError('getApiKey() has not been implemented.'); 27 | } 28 | 29 | Future setLicense(String licenseKey) { 30 | throw UnimplementedError('setLicense() has not been implemented.'); 31 | } 32 | 33 | Future getApiVersion() { 34 | throw UnimplementedError('getApiKey() has not been implemented.'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/method_channel/geometry/coordinate_formatter_flutter_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/method_channel/geometry/method_channel_coordinate_formatter_flutter.dart'; 3 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 4 | 5 | abstract class CoordinateFormatterFlutterPlatform extends PlatformInterface { 6 | static final Object _token = Object(); 7 | 8 | static CoordinateFormatterFlutterPlatform _instance = 9 | MethodChannelCoordinateFormatterFlutter(); 10 | 11 | CoordinateFormatterFlutterPlatform() : super(token: _token); 12 | 13 | static CoordinateFormatterFlutterPlatform get instance => _instance; 14 | 15 | /// Platform-specific plugins should set this with their own platform-specific 16 | /// class that extends [UrlLauncherPlatform] when they register themselves. 17 | static set instance(CoordinateFormatterFlutterPlatform instance) { 18 | PlatformInterface.verifyToken(instance, _token); 19 | _instance = instance; 20 | } 21 | 22 | Future latitudeLongitudeString({ 23 | required AGSPoint from, 24 | required LatitudeLongitudeFormat format, 25 | required int decimalPlaces, 26 | }) { 27 | throw UnimplementedError( 28 | 'latitudeLongitudeString() has not been implemented.'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/method_channel/geometry/method_channel_coordinate_formatter_flutter.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/method_channel/geometry/coordinate_formatter_flutter_platform.dart'; 3 | import 'package:flutter/services.dart'; 4 | 5 | class MethodChannelCoordinateFormatterFlutter 6 | extends CoordinateFormatterFlutterPlatform { 7 | final MethodChannel _channel = 8 | const OptionalMethodChannel("plugins.flutter.io/arcgis_channel/coordinate_formatter"); 9 | 10 | @override 11 | Future latitudeLongitudeString({ 12 | required AGSPoint from, 13 | required LatitudeLongitudeFormat format, 14 | required int decimalPlaces, 15 | }) async { 16 | return _channel.invokeMethod('latitudeLongitudeString', { 17 | "from": from.toJson(), 18 | "format": format.index, 19 | "decimalPlaces": decimalPlaces, 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/method_channel/method_channel_arcgis_flutter.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/method_channel/arcgis_flutter_platform.dart'; 3 | import 'package:flutter/services.dart'; 4 | 5 | class MethodChannelArcgisFlutter extends ArcgisFlutterPlatform { 6 | final MethodChannel _channel = 7 | const OptionalMethodChannel("plugins.flutter.io/arcgis_channel"); 8 | 9 | bool _didSetApiKey = false; 10 | 11 | @override 12 | Future setApiKey(String apiKey) async { 13 | if (_didSetApiKey) { 14 | return; 15 | } 16 | await _channel.invokeMethod('arcgis#setApiKey', apiKey); 17 | _didSetApiKey = true; 18 | } 19 | 20 | @override 21 | Future getApiKey() async { 22 | return await _channel.invokeMethod('arcgis#getApiKey') ?? ''; 23 | } 24 | 25 | @override 26 | Future setLicense(String licenseKey) async { 27 | final int? result = 28 | await _channel.invokeMethod('arcgis#setLicense', licenseKey); 29 | if(result == null){ 30 | return LicenseStatus.invalid; 31 | } 32 | return LicenseStatus.values[result]; 33 | } 34 | 35 | @override 36 | Future getApiVersion() async { 37 | return await _channel.invokeMethod('arcgis#getApiVersion') ?? ''; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/method_channel/native/native_message.dart: -------------------------------------------------------------------------------- 1 | class NativeMessage { 2 | final String objectId; 3 | final String method; 4 | final dynamic arguments; 5 | 6 | const NativeMessage({ 7 | required this.objectId, 8 | required this.method, 9 | required this.arguments, 10 | }); 11 | 12 | factory NativeMessage.fromJson(Map json) { 13 | return NativeMessage( 14 | objectId: json['objectId'] as String, 15 | method: json['method'] as String, 16 | arguments: json['arguments'], 17 | ); 18 | } 19 | 20 | @override 21 | bool operator ==(Object other) => 22 | identical(this, other) || 23 | other is NativeMessage && 24 | runtimeType == other.runtimeType && 25 | objectId == other.objectId && 26 | method == other.method && 27 | arguments == other.arguments; 28 | 29 | @override 30 | int get hashCode => objectId.hashCode ^ method.hashCode ^ arguments.hashCode; 31 | 32 | @override 33 | String toString() { 34 | return 'NativeMessage{objectId: $objectId, method: $method, arguments: $arguments}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/ogc/wms/wms_layer_style.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class WmsLayerStyle extends Equatable { 5 | const WmsLayerStyle({ 6 | required this.name, 7 | required this.title, 8 | required this.description, 9 | this.legendUrl, 10 | }); 11 | 12 | final String name; 13 | final String title; 14 | 15 | final String description; 16 | 17 | final WmsLegendUrl? legendUrl; 18 | 19 | @override 20 | List get props => []; 21 | } 22 | 23 | @immutable 24 | class WmsLegendUrl extends Equatable { 25 | const WmsLegendUrl({ 26 | required this.url, 27 | required this.imageFormat, 28 | this.width = 0, 29 | this.height = 0, 30 | }); 31 | 32 | final String url; 33 | 34 | final ImageFormat imageFormat; 35 | 36 | final int width; 37 | final int height; 38 | 39 | @override 40 | List get props => [ 41 | url, 42 | imageFormat, 43 | width, 44 | height, 45 | ]; 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/ogc/wms/wms_version.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum WmsVersion { 4 | v1_1_0, 5 | v1_1_1, 6 | v1_3_0, 7 | } 8 | 9 | extension WmsVersionExtension on WmsVersion { 10 | String get stringValue { 11 | switch (this) { 12 | case WmsVersion.v1_1_0: 13 | return '1.1.0'; 14 | case WmsVersion.v1_1_1: 15 | return '1.1.1'; 16 | case WmsVersion.v1_3_0: 17 | return '1.3.0'; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/portal/portal.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class Portal extends Equatable { 5 | const Portal({ 6 | required this.postalUrl, 7 | required this.loginRequired, 8 | this.credential, 9 | }); 10 | 11 | factory Portal.arcGISOnline({ 12 | required bool withLoginRequired, 13 | Credential? credential, 14 | }) => 15 | Portal( 16 | postalUrl: 'https://www.arcgis.com', 17 | loginRequired: withLoginRequired, 18 | credential: credential, 19 | ); 20 | 21 | final String postalUrl; 22 | 23 | final bool loginRequired; 24 | 25 | final Credential? credential; 26 | 27 | Object toJson() { 28 | final Map json = {}; 29 | json['postalUrl'] = postalUrl; 30 | json['loginRequired'] = loginRequired; 31 | if (credential != null) { 32 | json['credential'] = credential!.toJson(); 33 | } 34 | return json; 35 | } 36 | 37 | @override 38 | List get props => [postalUrl, loginRequired, credential]; 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/portal/portal_item.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class PortalItem extends Equatable { 5 | const PortalItem({ 6 | required this.portal, 7 | required this.itemId, 8 | }); 9 | 10 | final Portal portal; 11 | final String itemId; 12 | 13 | Object toJson() { 14 | final Map json = {}; 15 | json['portal'] = portal.toJson(); 16 | json['itemId'] = itemId; 17 | return json; 18 | } 19 | 20 | @override 21 | List get props => [portal, itemId]; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/security/credential.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | abstract class Credential { 5 | const Credential(); 6 | 7 | @Deprecated('Use UserCredential.createUserCredential instead') 8 | factory Credential.creteUserCredential({ 9 | required String username, 10 | required String password, 11 | String? referer, 12 | }) => 13 | UserCredential.createUserCredential( 14 | username: username, 15 | password: password, 16 | referer: referer, 17 | ); 18 | 19 | @Deprecated('Use UserCredential instead') 20 | factory Credential.createFromToken({ 21 | required String token, 22 | String? referer, 23 | }) => 24 | UserCredential.createFromToken( 25 | token: token, 26 | referer: referer, 27 | ); 28 | 29 | factory Credential.fromJson(Map json) { 30 | if (json['type'] == 'UserCredential') { 31 | return UserCredential.fromJson(json); 32 | } else { 33 | throw Exception('Unknown credential type: ${json['type']}'); 34 | } 35 | } 36 | 37 | Object toJson(); 38 | } -------------------------------------------------------------------------------- /lib/src/service_table/service_table.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum FeatureTableQueryFeatureFields { 4 | idsOnly("IDS_ONLY"), 5 | minimum("MINIMUM"), 6 | loadAll("LOAD_ALL"); 7 | 8 | final String name; 9 | 10 | const FeatureTableQueryFeatureFields(this.name); 11 | } 12 | 13 | class ServiceTable { 14 | final MethodChannelServiceTableFlutter _serviceTableFlutter = 15 | MethodChannelServiceTableFlutter(); 16 | 17 | Future> queryFeatures( 18 | String url, QueryParameters queryParameters, 19 | {FeatureTableQueryFeatureFields queryFields = 20 | FeatureTableQueryFeatureFields.loadAll}) async { 21 | return _serviceTableFlutter.queryFeatures(url, queryParameters, 22 | queryFields: queryFields); 23 | } 24 | 25 | Future queryStatisticsAsync( 26 | String url, StatisticsQueryParameters statisticsQueryParameters) async { 27 | return _serviceTableFlutter.queryStatisticsAsync(url, statisticsQueryParameters); 28 | } 29 | 30 | Future queryFeatureCount( 31 | String url, QueryParameters queryParameters) async { 32 | return _serviceTableFlutter.queryFeatureCount(url, queryParameters); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lib/src/symbology/cluster_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:fluster/fluster.dart'; 3 | 4 | class CLusterItem extends Clusterable { 5 | CLusterItem({required this.marker}) 6 | : super( 7 | latitude: marker.position.y, 8 | longitude: marker.position.x, 9 | markerId: marker.markerId.value, 10 | ); 11 | 12 | final Marker marker; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/symbology/marker_updates.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/maps_object_updates.dart'; 3 | 4 | class MarkerUpdates extends MapsObjectUpdates { 5 | MarkerUpdates.from(Set previous, Set current) 6 | : super.from(previous, current, objectName: 'marker'); 7 | } 8 | -------------------------------------------------------------------------------- /lib/src/symbology/polygon_updates.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/maps_object_updates.dart'; 3 | 4 | /// [Polygon] update events to be applied to the [ArcgisMapView]. 5 | /// 6 | // (Do not re-export) 7 | class PolygonUpdates extends MapsObjectUpdates { 8 | /// Computes [PolygonUpdates] given previous and current [Polygon]s. 9 | PolygonUpdates.from(Set previous, Set current) 10 | : super.from(previous, current, objectName: 'polygon'); 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/symbology/polyline_updates.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 3 | import 'package:arcgis_maps_flutter/src/maps_object_updates.dart'; 4 | 5 | /// [Polyline] update events to be applied to the [ArcgisMapView]. 6 | /// 7 | /// Used in [ArcgisMapController] when the map is updated. 8 | // (Do not re-export) 9 | class PolylineUpdates extends MapsObjectUpdates { 10 | /// Computes [PolylineUpdates] given previous and current [Polyline]s. 11 | PolylineUpdates.from(Set previous, Set current) 12 | : super.from(previous, current, objectName: 'polyline'); 13 | } -------------------------------------------------------------------------------- /lib/src/symbology/symbol.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | /// Uniquely identifies a [Marker] among [ArcgisMapView] markers. 4 | /// 5 | /// This does not have to be globally unique, only unique among the list. 6 | @immutable 7 | class SymbolId extends MapsObjectId { 8 | /// Creates an immutable identifier for a [Marker]. 9 | const SymbolId(String value) : super(value); 10 | } 11 | 12 | /// Marks a geographical location on the map. 13 | /// 14 | /// A marker icon is drawn oriented against the device's screen rather than 15 | /// the map's surface; that is, it will not necessarily change orientation 16 | /// due to map rotations, tilting, or zooming. 17 | @immutable 18 | abstract class Symbol implements MapsObject { 19 | const Symbol({ 20 | required this.symbolId, 21 | }); 22 | 23 | /// Uniquely identifies a [Symbol]. 24 | final SymbolId symbolId; 25 | 26 | @override 27 | SymbolId get mapsId => symbolId; 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/symbology/symbol_visibility_filter.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class SymbolVisibilityFilter { 5 | const SymbolVisibilityFilter({ 6 | required this.minZoom, 7 | required this.maxZoom, 8 | }) : assert(minZoom > maxZoom, 'minZoom should be greater then maxZoom'); 9 | 10 | final double minZoom; 11 | final double maxZoom; 12 | 13 | Object toJson() { 14 | final Map json = {}; 15 | 16 | json['minZoom'] = minZoom; 17 | json['maxZoom'] = maxZoom; 18 | 19 | return json; 20 | } 21 | 22 | @override 23 | bool operator ==(Object other) => 24 | identical(this, other) || 25 | other is SymbolVisibilityFilter && 26 | runtimeType == other.runtimeType && 27 | minZoom == other.minZoom && 28 | maxZoom == other.maxZoom; 29 | 30 | @override 31 | int get hashCode => minZoom.hashCode ^ maxZoom.hashCode; 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/tasks/geocode/locator_attribute.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum LocatorAttributeType { 4 | integer, 5 | double, 6 | string, 7 | boolean, 8 | unknown, 9 | } 10 | 11 | @immutable 12 | class LocatorAttribute { 13 | const LocatorAttribute._({ 14 | required this.name, 15 | required this.displayName, 16 | required this.required, 17 | this.type = LocatorAttributeType.unknown, 18 | }); 19 | 20 | static LocatorAttribute fromJson(Map json) { 21 | return LocatorAttribute._( 22 | name: json['name'] as String, 23 | displayName: json['displayName'] as String, 24 | required: json['required'] as bool, 25 | type: json.containsKey('type') 26 | ? LocatorAttributeType.values[json['type'] as int] 27 | : LocatorAttributeType.unknown, 28 | ); 29 | } 30 | 31 | /// Name of the attribute 32 | final String name; 33 | 34 | /// User-friendly name of the attribute 35 | final String displayName; 36 | 37 | /// Whether the attribute is mandatory to be specified as input. 38 | final bool required; 39 | 40 | final LocatorAttributeType type; 41 | 42 | @override 43 | String toString() { 44 | return 'LocatorAttribute{name: $name, displayName: $displayName, required: $required, type: $type}'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/tasks/geocode/suggest_result.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class SuggestResult { 5 | const SuggestResult._(this.label, this.isCollection, this._suggestResultId); 6 | 7 | factory SuggestResult.fromJson(Map json) { 8 | return SuggestResult._( 9 | json['label'] as String, 10 | json['isCollection'] as bool, 11 | json['suggestResultId'] as String, 12 | ); 13 | } 14 | 15 | final String label; 16 | final bool isCollection; 17 | final String _suggestResultId; 18 | 19 | Object toJson() => _suggestResultId; 20 | 21 | @override 22 | String toString() { 23 | return 'SuggestResult{label: $label, isCollection: $isCollection'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/tasks/geodatabase/generate_geodatabase_job.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class GenerateGeodatabaseJob extends Job { 4 | GenerateGeodatabaseJob._({ 5 | required String jobId, 6 | }) : super( 7 | objectId: jobId, 8 | isCreated: true, 9 | ); 10 | 11 | @override 12 | String get type => 'GenerateGeodatabaseJob'; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/attribute_parameter_value.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class AttributeParameterValue { 5 | const AttributeParameterValue._({ 6 | required this.attributeName, 7 | required this.parameterName, 8 | this.parameterValue, 9 | }); 10 | 11 | factory AttributeParameterValue.fromJson(Map json) { 12 | return AttributeParameterValue._( 13 | attributeName: json['attributeName'] as String, 14 | parameterName: json['parameterName'] as String, 15 | parameterValue: fromNativeField(json['parameterValue']), 16 | ); 17 | } 18 | 19 | final String attributeName; 20 | final String parameterName; 21 | 22 | final Object? parameterValue; 23 | 24 | Object toJson() { 25 | return { 26 | 'attributeName': attributeName, 27 | 'parameterName': parameterName, 28 | 'parameterValue': toNativeField(parameterValue), 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/cost_attribute.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class CostAttribute { 5 | const CostAttribute._({ 6 | this.parameterValues, 7 | required this.unit, 8 | }); 9 | 10 | factory CostAttribute.fromJson(Map json) { 11 | return CostAttribute._( 12 | parameterValues: parseAttributes(json['parameterValues']), 13 | unit: json.containsKey('unit') 14 | ? AttributeUnit.values[json['unit'] as int] 15 | : AttributeUnit.unknown, 16 | ); 17 | } 18 | 19 | final Map? parameterValues; 20 | 21 | final AttributeUnit unit; 22 | 23 | @override 24 | String toString(){ 25 | return 'CostAttribute{parameterValues: $parameterValues, unit: $unit}'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/direction_message.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class DirectionMessage { 5 | const DirectionMessage._({ 6 | required this.type, 7 | required this.text, 8 | }); 9 | 10 | factory DirectionMessage.fromJson(Map json) { 11 | return DirectionMessage._( 12 | type: _parseMessageType(json['type'] as int), 13 | text: json['text'], 14 | ); 15 | } 16 | 17 | static List fromJsonList(List json) { 18 | return json.map((e) => DirectionMessage.fromJson(e.cast())).toList(); 19 | } 20 | 21 | final DirectionMessageType type; 22 | 23 | final String text; 24 | } 25 | 26 | DirectionMessageType _parseMessageType(int type) { 27 | if (type < 9) { 28 | return DirectionMessageType.unknown; 29 | } 30 | return DirectionMessageType.values[type - 9]; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/restriction_attribute.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class RestrictionAttribute { 5 | const RestrictionAttribute._({ 6 | this.parameterValues, 7 | required this.restrictionUsageParameterName, 8 | }); 9 | 10 | factory RestrictionAttribute.fromJson(Map json) { 11 | return RestrictionAttribute._( 12 | parameterValues: parseAttributes(json['parameterValues']), 13 | restrictionUsageParameterName: json['restrictionUsageParameterName'], 14 | ); 15 | } 16 | 17 | final Map? parameterValues; 18 | final String restrictionUsageParameterName; 19 | 20 | @override 21 | String toString(){ 22 | return 'RestrictionAttribute{parameterValues: $parameterValues, restrictionUsageParameterName: $restrictionUsageParameterName}'; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/route_result.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class RouteResult { 5 | const RouteResult._({ 6 | required this.directionsLanguage, 7 | required this.messages, 8 | required this.routes, 9 | // TODO(vali): impl AGSPointBarrier/AGSPolygonBarrier/AGSPolylineBarrier 10 | }); 11 | 12 | factory RouteResult.fromJson(Map json) { 13 | return RouteResult._( 14 | directionsLanguage: json['directionsLanguage'] as String, 15 | messages: (json['messages'] as List).cast(), 16 | routes: Route.fromJsonList(json['routes'] as List), 17 | ); 18 | } 19 | 20 | /// The language used when computing directions. 21 | /// For example, en, fr, pt-BR, zh-Hans, etc. 22 | /// The list of languages supported is available in [RouteTaskInfo.supportedLanguages]. 23 | final String directionsLanguage; 24 | 25 | /// Informational messages that were generated while computing routes. 26 | final List messages; 27 | 28 | /// Each elements represents an indepdendent route with its own driving directions. 29 | /// Stops are grouped into diffrent routes based on [Stop.routeName] 30 | final List routes; 31 | 32 | @override 33 | String toString() { 34 | return 'RouteResult{directionsLanguage: $directionsLanguage, messages: $messages, routes: $routes}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/tasks/network_analysis/route_task.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class RouteTask extends ArcgisNativeObject 4 | with Loadable, RemoteResource, ApiKeyResource { 5 | final String _url; 6 | 7 | RouteTask({ 8 | required String url, 9 | Credential? credential, 10 | }) : _url = url { 11 | if (credential != null) { 12 | setCredential(credential); 13 | } 14 | } 15 | 16 | @override 17 | String get type => 'RouteTask'; 18 | 19 | @override 20 | dynamic getCreateArguments() => _url; 21 | 22 | Future getRouteTaskInfo() async { 23 | final result = await invokeMethod('routeTask#getRouteTaskInfo'); 24 | return RouteTaskInfo.fromJson(result); 25 | } 26 | 27 | Future createDefaultParameters() async { 28 | final result = await invokeMethod('routeTask#createDefaultParameters'); 29 | return RouteParameters.fromJson(result); 30 | } 31 | 32 | Future solveRoute(RouteParameters parameters) async { 33 | final result = await invokeMethod( 34 | 'routeTask#solveRoute', 35 | arguments: parameters.toJson(), 36 | ); 37 | return RouteResult.fromJson(result); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/tasks/offline_map/generate_offline_map_job.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class GenerateOfflineMapJob extends Job { 4 | GenerateOfflineMapJob._({ 5 | required String jobId, 6 | this.onlineMap, 7 | this.downloadDirectory, 8 | this.parameters, 9 | }) : super( 10 | objectId: jobId, 11 | isCreated: true, 12 | ); 13 | 14 | @override 15 | String get type => 'GenerateOfflineMapJob'; 16 | 17 | final ArcGISMap? onlineMap; 18 | 19 | final GenerateOfflineMapParameters? parameters; 20 | 21 | final String? downloadDirectory; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/tasks/offline_map/generate_offline_map_result.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | @immutable 4 | class GenerateOfflineMapResult { 5 | const GenerateOfflineMapResult._({ 6 | required this.offlineMap, 7 | required this.hasErrors, 8 | required this.layerErrors, 9 | required this.mobileMapPackage, 10 | }); 11 | 12 | final ArcGISMap offlineMap; 13 | final bool hasErrors; 14 | 15 | final Map layerErrors; 16 | 17 | //TODO(vali): implement AGSFeatureTable errors 18 | 19 | final MobileMapPackage mobileMapPackage; 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/tasks/tile_cache/estimate_tile_cache_size_job.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class EstimateTileCacheSizeResult { 4 | const EstimateTileCacheSizeResult({ 5 | required this.fileSize, 6 | required this.tileCount, 7 | }); 8 | 9 | factory EstimateTileCacheSizeResult.fromJson(Map json) { 10 | return EstimateTileCacheSizeResult( 11 | fileSize: json['fileSize'] as int, 12 | tileCount: json['tileCount'] as int, 13 | ); 14 | } 15 | 16 | final int fileSize; 17 | final int tileCount; 18 | } 19 | 20 | class EstimateTileCacheSizeJob extends Job { 21 | EstimateTileCacheSizeJob._({required String jobId}) 22 | : super( 23 | objectId: jobId, 24 | isCreated: true, 25 | ); 26 | 27 | Future get result async { 28 | final resultJson = await invokeMethod("estimateTileCacheSizeJob#getResult"); 29 | return resultJson == null 30 | ? null 31 | : EstimateTileCacheSizeResult.fromJson(resultJson); 32 | } 33 | 34 | @override 35 | String get type => "EstimateTileCacheSizeJob"; 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/tasks/tile_cache/export_tile_cache_job.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | class ExportTileCacheJob extends Job { 4 | ExportTileCacheJob._({required String jobId}) 5 | : super( 6 | objectId: jobId, 7 | isCreated: true, 8 | ); 9 | 10 | @override 11 | String get type => "ExportTileCacheJob"; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/unit_system.dart: -------------------------------------------------------------------------------- 1 | part of arcgis_maps_flutter; 2 | 3 | enum UnitSystem { 4 | /// Used for imperial units, e.g. miles 5 | imperial, 6 | 7 | /// Used for metric units, e.g. kilometers 8 | metric, 9 | 10 | /// Unknown. 11 | unknown, 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/utils/elevation_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/utils/maps_object.dart'; 3 | 4 | Object serializeElevationSourceSet(Set layers) { 5 | return serializeMapsObjectSet(layers); 6 | } 7 | -------------------------------------------------------------------------------- /lib/src/utils/json.dart: -------------------------------------------------------------------------------- 1 | // Map toSafeMap(dynamic o) { 2 | // return toSafeMapNullable(o)!; 3 | // } 4 | // 5 | // Map? toSafeMapNullable(dynamic o) { 6 | // if (o is String) { 7 | // return jsonDecode(o); 8 | // } 9 | // if (o is Map) { 10 | // return o; 11 | // } 12 | // return null; 13 | // } 14 | 15 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 16 | 17 | double toDoubleSafe(dynamic o) { 18 | return toDoubleSafeNullable(o)!; 19 | } 20 | 21 | double? toDoubleSafeNullable(dynamic o) { 22 | if (o is int) { 23 | return o.toDouble(); 24 | } 25 | if (o is double) { 26 | return o; 27 | } 28 | return null; 29 | } 30 | 31 | DateTime parseDateTime(dynamic o) { 32 | return parseDateTimeSafeNullable(o)!; 33 | } 34 | 35 | DateTime? parseDateTimeSafeNullable(dynamic o) { 36 | if (o is String) { 37 | return DateTime.tryParse(o); 38 | } 39 | return null; 40 | } 41 | 42 | List pointToList( 43 | AGSPoint point, { 44 | required bool hasZ, 45 | required bool hasM, 46 | }) { 47 | final pointLength = 2 + (hasZ ? 1 : 0) + (hasM ? 1 : 0); 48 | final List pointJson = List.generate(pointLength, (index) => 0.0); 49 | pointJson[0] = point.x; 50 | pointJson[1] = point.y; 51 | int i = 2; 52 | if (point.z != null) { 53 | pointJson[i] = point.z!; 54 | i++; 55 | } 56 | if (point.m != null) { 57 | pointJson[i] = point.m!; 58 | } 59 | return pointJson; 60 | } 61 | -------------------------------------------------------------------------------- /lib/src/utils/layers.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/utils/maps_object.dart'; 3 | 4 | Map keyByLayerId(Iterable layers) { 5 | return keyByMapsObjectId(layers).cast(); 6 | } 7 | 8 | Object serializeLayerSet(Set layers) { 9 | return serializeMapsObjectSet(layers); 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/utils/maps_object.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/maps_object.dart'; 3 | 4 | /// Converts an [Iterable] of [MapsObject]s in a Map of [MapObjectId] -> [MapObject]. 5 | Map, T> keyByMapsObjectId( 6 | Iterable objects) { 7 | return Map, T>.fromEntries(objects.map((T object) => 8 | MapEntry, T>( 9 | object.mapsId as MapsObjectId, object.clone()))); 10 | } 11 | 12 | /// Converts a Set of [MapsObject]s into something serializable in JSON. 13 | Object serializeMapsObjectSet(Set mapsObjects) { 14 | return mapsObjects.map((MapsObject p) => p.toJson()).toList(); 15 | } 16 | 17 | /// Converts a List of [Geometry]s into something serializable in JSON. 18 | Object serializeGeometryList(List items) { 19 | return items.map((Geometry p) => p.toJson()).toList(); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /lib/src/utils/markers.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 3 | import 'package:arcgis_maps_flutter/src/utils/maps_object.dart'; 4 | 5 | /// Converts an [Iterable] of Markers in a Map of MarkerId -> Marker. 6 | Map keyByMarkerId(Iterable markers) { 7 | return keyByMapsObjectId(markers).cast(); 8 | } 9 | 10 | /// Converts a Set of Markers into something serializable in JSON. 11 | Object serializeMarkerSet(Set markers) { 12 | return serializeMapsObjectSet(markers); 13 | } -------------------------------------------------------------------------------- /lib/src/utils/polygons.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/utils/maps_object.dart'; 3 | 4 | /// Converts an [Iterable] of Polygon in a Map of MarkerId -> Marker. 5 | Map keyByPolygonId(Iterable markers) { 6 | return keyByMapsObjectId(markers).cast(); 7 | } 8 | 9 | /// Converts a Set of Markers into something serializable in JSON. 10 | Object serializePolygonSet(Set markers) { 11 | return serializeMapsObjectSet(markers); 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/utils/polyline.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:arcgis_maps_flutter/src/utils/maps_object.dart'; 3 | 4 | /// Converts an [Iterable] of Polylines in a Map of PolylineId -> Polyline. 5 | Map keyByPolylineId(Iterable polylines) { 6 | return keyByMapsObjectId(polylines).cast(); 7 | } 8 | 9 | /// Converts a Set of Polylines into something serializable in JSON. 10 | Object serializePolylineSet(Set polylines) { 11 | return serializeMapsObjectSet(polylines); 12 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: arcgis_maps_flutter 2 | description: A new flutter plugin project. 3 | version: 0.0.6+43 4 | homepage: https://github.com/valentingrigorean/arcgis_maps_flutter 5 | 6 | environment: 7 | sdk: ">=2.17.0 <3.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | plugin_platform_interface: ^2.1.4 14 | stream_transform: ^2.1.0 15 | collection: ^1.17.0 16 | fluster: ^1.2.0 17 | equatable: ^2.0.5 18 | http: ^0.13.5 19 | xml2json: ^5.3.6 20 | jiffy: ^6.1.0 21 | 22 | dev_dependencies: 23 | flutter_test: 24 | sdk: flutter 25 | flutter_lints: ^2.0.1 26 | mockito: ^5.4.0 27 | build_runner: ^2.3.3 28 | 29 | flutter: 30 | plugin: 31 | platforms: 32 | android: 33 | package: com.valentingrigorean.arcgis_maps_flutter 34 | pluginClass: ArcgisMapsFlutterPlugin 35 | ios: 36 | pluginClass: ArcgisMapsFlutterPlugin 37 | 38 | # To add assets to your plugin package, add an assets section, like this: 39 | assets: 40 | - assets/ic_compass.png 41 | - assets/2.0x/ic_compass.png 42 | - assets/3.0x/ic_compass.png 43 | -------------------------------------------------------------------------------- /test/arcgis_runtime_environment_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | const MethodChannel channel = MethodChannel('plugins.flutter.io/arcgis_channel'); 7 | 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | 10 | setUp(() { 11 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 12 | if(methodCall.method == "arcgis#getApiVersion"){ 13 | return '42'; 14 | } 15 | }); 16 | }); 17 | 18 | tearDown(() { 19 | channel.setMockMethodCallHandler(null); 20 | }); 21 | 22 | test('getPlatformVersion', () async { 23 | expect(await ArcGISRuntimeEnvironment.getAPIVersion(), '42'); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /test/layers/layer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | class LayerMock extends Layer { 5 | const LayerMock({ 6 | required bool isVisible, 7 | required double opacity, 8 | required LayerId layerId, 9 | }) : super( 10 | isVisible: isVisible, 11 | opacity: opacity, 12 | layerId: layerId, 13 | ); 14 | 15 | @override 16 | Layer clone() { 17 | throw UnimplementedError(); 18 | } 19 | } 20 | 21 | void main() { 22 | test('Ctor', () { 23 | const layer = LayerMock( 24 | isVisible: true, 25 | opacity: 1, 26 | layerId: LayerId('layerId'), 27 | ); 28 | 29 | expect(layer.opacity, 1.0); 30 | expect(layer.isVisible, true); 31 | expect(layer.layerId, const LayerId('layerId')); 32 | }); 33 | 34 | test('toJson', () { 35 | const layer = LayerMock( 36 | isVisible: true, 37 | opacity: 1, 38 | layerId: LayerId('layerId'), 39 | ); 40 | 41 | final json = layer.toJson(); 42 | expect(json['opacity'], 1.0); 43 | expect(json['isVisible'], true); 44 | expect(json['layerId'],'layerId'); 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /test/layers/wms_layer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test('toJson', () { 6 | final wmsLayer = WmsLayer.fromUrl('url', layersName: ['1', '2', '3']); 7 | final json = wmsLayer.toJson(); 8 | 9 | final layersName = json['layersName']; 10 | assert(layersName != null); 11 | assert(layersName is List); 12 | if (layersName is List) { 13 | assert(layersName.length == 3); 14 | } 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /test/toolkit/time_slider_test.dart: -------------------------------------------------------------------------------- 1 | // import 'package:arcgis_maps_flutter/arcgis_maps_flutter.dart'; 2 | // import 'package:flutter_test/flutter_test.dart'; 3 | // 4 | // void main() { 5 | // group('TimeSliderController', () { 6 | // test('Generate timeSteps interval 5min', () { 7 | // final controller = TimeSliderController(); 8 | // controller.fullExtent = TimeExtent( 9 | // startTime: DateTime.now(), 10 | // endTime: DateTime.now().add(const Duration(hours: 1)), 11 | // ); 12 | // 13 | // expect(controller.timeSteps.length, 12); 14 | // }); 15 | // 16 | // test('Generate timeSteps interval 1min', () { 17 | // final controller = TimeSliderController( 18 | // timeStepInterval: const TimeValue( 19 | // duration: 1, 20 | // unit: TimeUnit.minutes, 21 | // )); 22 | // controller.fullExtent = TimeExtent( 23 | // startTime: DateTime.now(), 24 | // endTime: DateTime.now().add(const Duration(hours: 1)), 25 | // ); 26 | // 27 | // expect(controller.timeSteps.length, 60); 28 | // }); 29 | // }); 30 | // } 31 | --------------------------------------------------------------------------------