Skip to content

Commit 4c5f029

Browse files
authored
Apply Common Design to Show Magnifier Sample (#85)
* Add README * Add screen capture * Generate metadata * Update generated_samples_list.json * Add comments * Update README.md
1 parent 97830be commit 4c5f029

File tree

5 files changed

+139
-16
lines changed

5 files changed

+139
-16
lines changed

assets/generated_samples_list.json

Lines changed: 82 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,45 @@
718718
"category": "Search and Query",
719719
"description": "Query a table to get aggregated statistics back for a specific field.",
720720
"ignore": false,
721-
"images": [],
722-
"keywords": [],
721+
"images": [
722+
"query_table_statistics.png"
723+
],
724+
"keywords": [
725+
"analysis",
726+
"average",
727+
"bounding geometry",
728+
"filter",
729+
"intersect",
730+
"maximum",
731+
"mean",
732+
"minimum",
733+
"query",
734+
"spatial query",
735+
"standard deviation",
736+
"statistics",
737+
"sum",
738+
"variance",
739+
"QueryParameters",
740+
"ServiceFeatureTable",
741+
"StatisticDefinition",
742+
"StatisticRecord",
743+
"StatisticType",
744+
"StatisticsQueryParameters",
745+
"StatisticsQueryResult"
746+
],
723747
"redirect_from": [],
724-
"relevant_apis": [],
725-
"snippets": [],
748+
"relevant_apis": [
749+
"QueryParameters",
750+
"ServiceFeatureTable",
751+
"StatisticDefinition",
752+
"StatisticRecord",
753+
"StatisticType",
754+
"StatisticsQueryParameters",
755+
"StatisticsQueryResult"
756+
],
757+
"snippets": [
758+
"query_table_statistics_sample.dart"
759+
],
726760
"title": "Query table statistics",
727761
"key": "query_table_statistics"
728762
},
@@ -742,11 +776,28 @@
742776
"category": "Search and Query",
743777
"description": "Select features in a feature layer.",
744778
"ignore": false,
745-
"images": [],
746-
"keywords": [],
779+
"images": [
780+
"select_features_in_feature_layer.png"
781+
],
782+
"keywords": [
783+
"features",
784+
"layers",
785+
"select",
786+
"selection",
787+
"tolerance",
788+
"Feature",
789+
"FeatureLayer",
790+
"ServiceFeatureTable"
791+
],
747792
"redirect_from": [],
748-
"relevant_apis": [],
749-
"snippets": [],
793+
"relevant_apis": [
794+
"Feature",
795+
"FeatureLayer",
796+
"ServiceFeatureTable"
797+
],
798+
"snippets": [
799+
"select_features_in_feature_layer_sample.dart"
800+
],
750801
"title": "Select features in feature layer",
751802
"key": "select_features_in_feature_layer"
752803
},
@@ -860,11 +911,30 @@
860911
"category": "Maps",
861912
"description": "Tap and hold on a map to show a magnifier.",
862913
"ignore": false,
863-
"images": [],
864-
"keywords": [],
914+
"images": [
915+
"show_magnifier.png"
916+
],
917+
"keywords": [
918+
"magnify",
919+
"map",
920+
"zoom",
921+
"ArcGISMap",
922+
"ArcGISMapView",
923+
"ArcGISMapViewController",
924+
"ArcGISMapViewController.allowMagnifierToPanMap",
925+
"ArcGISMapViewController.magnifiedEnabled"
926+
],
865927
"redirect_from": [],
866-
"relevant_apis": [],
867-
"snippets": [],
928+
"relevant_apis": [
929+
"ArcGISMap",
930+
"ArcGISMapView",
931+
"ArcGISMapViewController",
932+
"ArcGISMapViewController.allowMagnifierToPanMap",
933+
"ArcGISMapViewController.magnifiedEnabled"
934+
],
935+
"snippets": [
936+
"show_magnifier_sample.dart"
937+
],
868938
"title": "Show magnifier",
869939
"key": "show_magnifier"
870940
},
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Show magnifier
2+
3+
Tap and hold on a map to show a magnifier.
4+
5+
![Image of show magnifier](show_magnifier.png)
6+
7+
## Use case
8+
9+
Due to the limited screen size of some mobile devices, it may be difficult to identify individual features on a map where there is a high density of information, or the scale is very small. This can be the case when a mobile device is used for navigation, and the user wishes to magnify a particular area to better identify a road intersection.
10+
11+
## How to use the sample
12+
13+
Tap and hold on the map to show a magnifier, then drag across the map to move the magnifier. You can also pan the map while holding the magnifier, by dragging the magnifier to the edge of the map.
14+
15+
## How it works
16+
17+
1. Create a new `ArcGISMapView` with an `ArcGISMapViewController`, and assign an `ArcGISMap` to the `ArcGISMapViewController.arcGISMap` property.
18+
2. Enable the magnifier by setting the `ArcGISMapViewController.magnifiedEnabled` property to `true`. This will set the magnifier to be shown on the `ArcGISMap` when the user performs a long press gesture. Note: The default value is `false`.
19+
3. Optionally, set the `ArcGISMapViewController.allowMagnifierToPanMap` property to `true` to allow the map to be panned automatically when the magnifier gets near the edge of the `ArcGISMap`. Note: The default value is `true`.
20+
21+
## Relevant API
22+
23+
* ArcGISMap
24+
* ArcGISMapView
25+
* ArcGISMapViewController
26+
* ArcGISMapViewController.allowMagnifierToPanMap
27+
* ArcGISMapViewController.magnifiedEnabled
28+
29+
## Tags
30+
31+
magnify, map, zoom

lib/samples/show_magnifier/README.metadata.json

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22
"category": "Maps",
33
"description": "Tap and hold on a map to show a magnifier.",
44
"ignore": false,
5-
"images": [],
6-
"keywords": [],
5+
"images": [
6+
"show_magnifier.png"
7+
],
8+
"keywords": [
9+
"magnify",
10+
"map",
11+
"zoom",
12+
"ArcGISMap",
13+
"ArcGISMapView",
14+
"ArcGISMapViewController",
15+
"ArcGISMapViewController.allowMagnifierToPanMap",
16+
"ArcGISMapViewController.magnifiedEnabled"
17+
],
718
"redirect_from": [],
8-
"relevant_apis": [],
9-
"snippets": [],
19+
"relevant_apis": [
20+
"ArcGISMap",
21+
"ArcGISMapView",
22+
"ArcGISMapViewController",
23+
"ArcGISMapViewController.allowMagnifierToPanMap",
24+
"ArcGISMapViewController.magnifiedEnabled"
25+
],
26+
"snippets": [
27+
"show_magnifier_sample.dart"
28+
],
1029
"title": "Show magnifier"
1130
}
490 KB
Loading

lib/samples/show_magnifier/show_magnifier_sample.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ class ShowMagnifierSample extends StatelessWidget {
2323
@override
2424
Widget build(BuildContext context) {
2525
return Scaffold(
26+
// Add a map view to the widget tree and set a controller.
2627
body: ArcGISMapView(
2728
controllerProvider: () => ArcGISMapView.createController()
29+
// Set a map with an initial viewpoint.
2830
..arcGISMap =
2931
ArcGISMap.withBasemapStyle(BasemapStyle.arcGISImageryStandard)
3032
..arcGISMap!.initialViewpoint = Viewpoint.fromCenter(
@@ -35,6 +37,7 @@ class ShowMagnifierSample extends StatelessWidget {
3537
),
3638
scale: 2e4,
3739
)
40+
// Set the magnifier enabled property to true to show the magnifier on long press.
3841
..magnifierEnabled = true,
3942
),
4043
);

0 commit comments

Comments
 (0)