├── .gitignore
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── contents.xcworkspacedata
├── AMJpnMap.podspec
├── AMJpnMap.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ └── AMJpnMap.xcscheme
├── AMJpnMap
├── AMJpnMap.h
└── Info.plist
├── LICENSE
├── Package.swift
├── README.md
├── SampleAMJpnMap
├── SampleAMJpnMap.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── SampleAMJpnMap
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Classes
│ ├── AppDelegate.swift
│ ├── SecondViewController.swift
│ └── ViewController.swift
│ └── Info.plist
└── Source
├── AMJpnMapView.swift
├── Detail
├── AMJMRegionLayer.swift
└── AMJpnMapDetailView.swift
└── enums
├── AMPrefecture.swift
└── AMRegion.swift
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode (from gitignore.io)
2 | build/
3 | *.pbxuser
4 | !default.pbxuser
5 | *.mode1v3
6 | !default.mode1v3
7 | *.mode2v3
8 | !default.mode2v3
9 | *.perspectivev3
10 | !default.perspectivev3
11 | xcuserdata
12 | *.xccheckout
13 | *.moved-aside
14 | DerivedData
15 | *.hmap
16 | *.ipa
17 | *.xcuserstate
18 |
19 | # CocoaPod
20 | Pods/*
21 | Podfile.lock
22 |
23 | # Carthage
24 | Carthage/Build
25 |
26 | # others
27 | *.swp
28 | !.gitkeep
29 | .DS_Store
30 | UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AMJpnMap.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "AMJpnMap"
3 | s.version = "2.1.1"
4 | s.summary = "It can display a simple map of Japan."
5 | s.license = { :type => 'MIT', :file => 'LICENSE' }
6 | s.homepage = "https://github.com/adventam10/AMJpnMapView"
7 | s.author = { "am10" => "adventam10@gmail.com" }
8 | s.source = { :git => "https://github.com/adventam10/AMJpnMapView.git", :tag => "#{s.version}" }
9 | s.platform = :ios, "9.0"
10 | s.requires_arc = true
11 | s.source_files = 'Source/**/*.{swift}'
12 | s.swift_version = "5.0"
13 | end
14 |
--------------------------------------------------------------------------------
/AMJpnMap.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0E5806062026F2EB00500483 /* AMJpnMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E5806042026F2EB00500483 /* AMJpnMap.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | 0EB234BF2354879F00442A85 /* AMRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234B92354879F00442A85 /* AMRegion.swift */; };
12 | 0EB234C02354879F00442A85 /* AMPrefecture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234BA2354879F00442A85 /* AMPrefecture.swift */; };
13 | 0EB234C12354879F00442A85 /* AMJpnMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234BB2354879F00442A85 /* AMJpnMapView.swift */; };
14 | 0EB234C22354879F00442A85 /* AMJpnMapDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234BD2354879F00442A85 /* AMJpnMapDetailView.swift */; };
15 | 0EB234C32354879F00442A85 /* AMJMRegionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234BE2354879F00442A85 /* AMJMRegionLayer.swift */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | 0E5806012026F2EB00500483 /* AMJpnMap.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AMJpnMap.framework; sourceTree = BUILT_PRODUCTS_DIR; };
20 | 0E5806042026F2EB00500483 /* AMJpnMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AMJpnMap.h; sourceTree = ""; };
21 | 0E5806052026F2EB00500483 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
22 | 0EB234B92354879F00442A85 /* AMRegion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMRegion.swift; sourceTree = ""; };
23 | 0EB234BA2354879F00442A85 /* AMPrefecture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMPrefecture.swift; sourceTree = ""; };
24 | 0EB234BB2354879F00442A85 /* AMJpnMapView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJpnMapView.swift; sourceTree = ""; };
25 | 0EB234BD2354879F00442A85 /* AMJpnMapDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJpnMapDetailView.swift; sourceTree = ""; };
26 | 0EB234BE2354879F00442A85 /* AMJMRegionLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJMRegionLayer.swift; sourceTree = ""; };
27 | /* End PBXFileReference section */
28 |
29 | /* Begin PBXFrameworksBuildPhase section */
30 | 0E5805FD2026F2EB00500483 /* Frameworks */ = {
31 | isa = PBXFrameworksBuildPhase;
32 | buildActionMask = 2147483647;
33 | files = (
34 | );
35 | runOnlyForDeploymentPostprocessing = 0;
36 | };
37 | /* End PBXFrameworksBuildPhase section */
38 |
39 | /* Begin PBXGroup section */
40 | 0E5805F72026F2EB00500483 = {
41 | isa = PBXGroup;
42 | children = (
43 | 0EB234B72354879F00442A85 /* Source */,
44 | 0E5806032026F2EB00500483 /* AMJpnMap */,
45 | 0E5806022026F2EB00500483 /* Products */,
46 | );
47 | sourceTree = "";
48 | };
49 | 0E5806022026F2EB00500483 /* Products */ = {
50 | isa = PBXGroup;
51 | children = (
52 | 0E5806012026F2EB00500483 /* AMJpnMap.framework */,
53 | );
54 | name = Products;
55 | sourceTree = "";
56 | };
57 | 0E5806032026F2EB00500483 /* AMJpnMap */ = {
58 | isa = PBXGroup;
59 | children = (
60 | 0E5806042026F2EB00500483 /* AMJpnMap.h */,
61 | 0E5806052026F2EB00500483 /* Info.plist */,
62 | );
63 | path = AMJpnMap;
64 | sourceTree = "";
65 | };
66 | 0EB234B72354879F00442A85 /* Source */ = {
67 | isa = PBXGroup;
68 | children = (
69 | 0EB234B82354879F00442A85 /* enums */,
70 | 0EB234BB2354879F00442A85 /* AMJpnMapView.swift */,
71 | 0EB234BC2354879F00442A85 /* Detail */,
72 | );
73 | path = Source;
74 | sourceTree = "";
75 | };
76 | 0EB234B82354879F00442A85 /* enums */ = {
77 | isa = PBXGroup;
78 | children = (
79 | 0EB234B92354879F00442A85 /* AMRegion.swift */,
80 | 0EB234BA2354879F00442A85 /* AMPrefecture.swift */,
81 | );
82 | path = enums;
83 | sourceTree = "";
84 | };
85 | 0EB234BC2354879F00442A85 /* Detail */ = {
86 | isa = PBXGroup;
87 | children = (
88 | 0EB234BD2354879F00442A85 /* AMJpnMapDetailView.swift */,
89 | 0EB234BE2354879F00442A85 /* AMJMRegionLayer.swift */,
90 | );
91 | path = Detail;
92 | sourceTree = "";
93 | };
94 | /* End PBXGroup section */
95 |
96 | /* Begin PBXHeadersBuildPhase section */
97 | 0E5805FE2026F2EB00500483 /* Headers */ = {
98 | isa = PBXHeadersBuildPhase;
99 | buildActionMask = 2147483647;
100 | files = (
101 | 0E5806062026F2EB00500483 /* AMJpnMap.h in Headers */,
102 | );
103 | runOnlyForDeploymentPostprocessing = 0;
104 | };
105 | /* End PBXHeadersBuildPhase section */
106 |
107 | /* Begin PBXNativeTarget section */
108 | 0E5806002026F2EB00500483 /* AMJpnMap */ = {
109 | isa = PBXNativeTarget;
110 | buildConfigurationList = 0E5806092026F2EB00500483 /* Build configuration list for PBXNativeTarget "AMJpnMap" */;
111 | buildPhases = (
112 | 0E5805FC2026F2EB00500483 /* Sources */,
113 | 0E5805FD2026F2EB00500483 /* Frameworks */,
114 | 0E5805FE2026F2EB00500483 /* Headers */,
115 | 0E5805FF2026F2EB00500483 /* Resources */,
116 | );
117 | buildRules = (
118 | );
119 | dependencies = (
120 | );
121 | name = AMJpnMap;
122 | productName = AMJpnMap;
123 | productReference = 0E5806012026F2EB00500483 /* AMJpnMap.framework */;
124 | productType = "com.apple.product-type.framework";
125 | };
126 | /* End PBXNativeTarget section */
127 |
128 | /* Begin PBXProject section */
129 | 0E5805F82026F2EB00500483 /* Project object */ = {
130 | isa = PBXProject;
131 | attributes = {
132 | LastUpgradeCheck = 1020;
133 | ORGANIZATIONNAME = am10;
134 | TargetAttributes = {
135 | 0E5806002026F2EB00500483 = {
136 | CreatedOnToolsVersion = 9.2;
137 | LastSwiftMigration = 1020;
138 | ProvisioningStyle = Automatic;
139 | };
140 | };
141 | };
142 | buildConfigurationList = 0E5805FB2026F2EB00500483 /* Build configuration list for PBXProject "AMJpnMap" */;
143 | compatibilityVersion = "Xcode 8.0";
144 | developmentRegion = en;
145 | hasScannedForEncodings = 0;
146 | knownRegions = (
147 | en,
148 | Base,
149 | );
150 | mainGroup = 0E5805F72026F2EB00500483;
151 | productRefGroup = 0E5806022026F2EB00500483 /* Products */;
152 | projectDirPath = "";
153 | projectRoot = "";
154 | targets = (
155 | 0E5806002026F2EB00500483 /* AMJpnMap */,
156 | );
157 | };
158 | /* End PBXProject section */
159 |
160 | /* Begin PBXResourcesBuildPhase section */
161 | 0E5805FF2026F2EB00500483 /* Resources */ = {
162 | isa = PBXResourcesBuildPhase;
163 | buildActionMask = 2147483647;
164 | files = (
165 | );
166 | runOnlyForDeploymentPostprocessing = 0;
167 | };
168 | /* End PBXResourcesBuildPhase section */
169 |
170 | /* Begin PBXSourcesBuildPhase section */
171 | 0E5805FC2026F2EB00500483 /* Sources */ = {
172 | isa = PBXSourcesBuildPhase;
173 | buildActionMask = 2147483647;
174 | files = (
175 | 0EB234C32354879F00442A85 /* AMJMRegionLayer.swift in Sources */,
176 | 0EB234C02354879F00442A85 /* AMPrefecture.swift in Sources */,
177 | 0EB234C22354879F00442A85 /* AMJpnMapDetailView.swift in Sources */,
178 | 0EB234BF2354879F00442A85 /* AMRegion.swift in Sources */,
179 | 0EB234C12354879F00442A85 /* AMJpnMapView.swift in Sources */,
180 | );
181 | runOnlyForDeploymentPostprocessing = 0;
182 | };
183 | /* End PBXSourcesBuildPhase section */
184 |
185 | /* Begin XCBuildConfiguration section */
186 | 0E5806072026F2EB00500483 /* Debug */ = {
187 | isa = XCBuildConfiguration;
188 | buildSettings = {
189 | ALWAYS_SEARCH_USER_PATHS = NO;
190 | CLANG_ANALYZER_NONNULL = YES;
191 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
192 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
193 | CLANG_CXX_LIBRARY = "libc++";
194 | CLANG_ENABLE_MODULES = YES;
195 | CLANG_ENABLE_OBJC_ARC = YES;
196 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
197 | CLANG_WARN_BOOL_CONVERSION = YES;
198 | CLANG_WARN_COMMA = YES;
199 | CLANG_WARN_CONSTANT_CONVERSION = YES;
200 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
202 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
203 | CLANG_WARN_EMPTY_BODY = YES;
204 | CLANG_WARN_ENUM_CONVERSION = YES;
205 | CLANG_WARN_INFINITE_RECURSION = YES;
206 | CLANG_WARN_INT_CONVERSION = YES;
207 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
208 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
209 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
210 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
211 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
212 | CLANG_WARN_STRICT_PROTOTYPES = YES;
213 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
214 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
215 | CLANG_WARN_UNREACHABLE_CODE = YES;
216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
217 | CODE_SIGN_IDENTITY = "iPhone Developer";
218 | COPY_PHASE_STRIP = NO;
219 | CURRENT_PROJECT_VERSION = 1;
220 | DEBUG_INFORMATION_FORMAT = dwarf;
221 | ENABLE_STRICT_OBJC_MSGSEND = YES;
222 | ENABLE_TESTABILITY = YES;
223 | GCC_C_LANGUAGE_STANDARD = gnu11;
224 | GCC_DYNAMIC_NO_PIC = NO;
225 | GCC_NO_COMMON_BLOCKS = YES;
226 | GCC_OPTIMIZATION_LEVEL = 0;
227 | GCC_PREPROCESSOR_DEFINITIONS = (
228 | "DEBUG=1",
229 | "$(inherited)",
230 | );
231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
233 | GCC_WARN_UNDECLARED_SELECTOR = YES;
234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
235 | GCC_WARN_UNUSED_FUNCTION = YES;
236 | GCC_WARN_UNUSED_VARIABLE = YES;
237 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
238 | MTL_ENABLE_DEBUG_INFO = YES;
239 | ONLY_ACTIVE_ARCH = YES;
240 | SDKROOT = iphoneos;
241 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
242 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
243 | VERSIONING_SYSTEM = "apple-generic";
244 | VERSION_INFO_PREFIX = "";
245 | };
246 | name = Debug;
247 | };
248 | 0E5806082026F2EB00500483 /* Release */ = {
249 | isa = XCBuildConfiguration;
250 | buildSettings = {
251 | ALWAYS_SEARCH_USER_PATHS = NO;
252 | CLANG_ANALYZER_NONNULL = YES;
253 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
255 | CLANG_CXX_LIBRARY = "libc++";
256 | CLANG_ENABLE_MODULES = YES;
257 | CLANG_ENABLE_OBJC_ARC = YES;
258 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
259 | CLANG_WARN_BOOL_CONVERSION = YES;
260 | CLANG_WARN_COMMA = YES;
261 | CLANG_WARN_CONSTANT_CONVERSION = YES;
262 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
263 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
264 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
265 | CLANG_WARN_EMPTY_BODY = YES;
266 | CLANG_WARN_ENUM_CONVERSION = YES;
267 | CLANG_WARN_INFINITE_RECURSION = YES;
268 | CLANG_WARN_INT_CONVERSION = YES;
269 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
270 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
271 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
273 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
274 | CLANG_WARN_STRICT_PROTOTYPES = YES;
275 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
276 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
277 | CLANG_WARN_UNREACHABLE_CODE = YES;
278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
279 | CODE_SIGN_IDENTITY = "iPhone Developer";
280 | COPY_PHASE_STRIP = NO;
281 | CURRENT_PROJECT_VERSION = 1;
282 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
283 | ENABLE_NS_ASSERTIONS = NO;
284 | ENABLE_STRICT_OBJC_MSGSEND = YES;
285 | GCC_C_LANGUAGE_STANDARD = gnu11;
286 | GCC_NO_COMMON_BLOCKS = YES;
287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
289 | GCC_WARN_UNDECLARED_SELECTOR = YES;
290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
291 | GCC_WARN_UNUSED_FUNCTION = YES;
292 | GCC_WARN_UNUSED_VARIABLE = YES;
293 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
294 | MTL_ENABLE_DEBUG_INFO = NO;
295 | SDKROOT = iphoneos;
296 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
297 | VALIDATE_PRODUCT = YES;
298 | VERSIONING_SYSTEM = "apple-generic";
299 | VERSION_INFO_PREFIX = "";
300 | };
301 | name = Release;
302 | };
303 | 0E58060A2026F2EB00500483 /* Debug */ = {
304 | isa = XCBuildConfiguration;
305 | buildSettings = {
306 | CODE_SIGN_IDENTITY = "";
307 | CODE_SIGN_STYLE = Automatic;
308 | DEFINES_MODULE = YES;
309 | DEVELOPMENT_TEAM = "";
310 | DYLIB_COMPATIBILITY_VERSION = 1;
311 | DYLIB_CURRENT_VERSION = 1;
312 | DYLIB_INSTALL_NAME_BASE = "@rpath";
313 | INFOPLIST_FILE = AMJpnMap/Info.plist;
314 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
315 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
316 | PRODUCT_BUNDLE_IDENTIFIER = am10.AMJpnMap;
317 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
318 | SKIP_INSTALL = YES;
319 | SWIFT_VERSION = 5.0;
320 | TARGETED_DEVICE_FAMILY = "1,2";
321 | };
322 | name = Debug;
323 | };
324 | 0E58060B2026F2EB00500483 /* Release */ = {
325 | isa = XCBuildConfiguration;
326 | buildSettings = {
327 | CODE_SIGN_IDENTITY = "";
328 | CODE_SIGN_STYLE = Automatic;
329 | DEFINES_MODULE = YES;
330 | DEVELOPMENT_TEAM = "";
331 | DYLIB_COMPATIBILITY_VERSION = 1;
332 | DYLIB_CURRENT_VERSION = 1;
333 | DYLIB_INSTALL_NAME_BASE = "@rpath";
334 | INFOPLIST_FILE = AMJpnMap/Info.plist;
335 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
336 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
337 | PRODUCT_BUNDLE_IDENTIFIER = am10.AMJpnMap;
338 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
339 | SKIP_INSTALL = YES;
340 | SWIFT_VERSION = 5.0;
341 | TARGETED_DEVICE_FAMILY = "1,2";
342 | };
343 | name = Release;
344 | };
345 | /* End XCBuildConfiguration section */
346 |
347 | /* Begin XCConfigurationList section */
348 | 0E5805FB2026F2EB00500483 /* Build configuration list for PBXProject "AMJpnMap" */ = {
349 | isa = XCConfigurationList;
350 | buildConfigurations = (
351 | 0E5806072026F2EB00500483 /* Debug */,
352 | 0E5806082026F2EB00500483 /* Release */,
353 | );
354 | defaultConfigurationIsVisible = 0;
355 | defaultConfigurationName = Release;
356 | };
357 | 0E5806092026F2EB00500483 /* Build configuration list for PBXNativeTarget "AMJpnMap" */ = {
358 | isa = XCConfigurationList;
359 | buildConfigurations = (
360 | 0E58060A2026F2EB00500483 /* Debug */,
361 | 0E58060B2026F2EB00500483 /* Release */,
362 | );
363 | defaultConfigurationIsVisible = 0;
364 | defaultConfigurationName = Release;
365 | };
366 | /* End XCConfigurationList section */
367 | };
368 | rootObject = 0E5805F82026F2EB00500483 /* Project object */;
369 | }
370 |
--------------------------------------------------------------------------------
/AMJpnMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AMJpnMap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AMJpnMap.xcodeproj/xcshareddata/xcschemes/AMJpnMap.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/AMJpnMap/AMJpnMap.h:
--------------------------------------------------------------------------------
1 | //
2 | // AMJpnMap.h
3 | // AMJpnMap
4 | //
5 | // Created by am10 on 2018/02/04.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for AMJpnMap.
12 | FOUNDATION_EXPORT double AMJpnMapVersionNumber;
13 |
14 | //! Project version string for AMJpnMap.
15 | FOUNDATION_EXPORT const unsigned char AMJpnMapVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/AMJpnMap/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 adventam10
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 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 | //
4 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
5 | //
6 | // Created by am10 on 2019/10/14.
7 | // Copyright © 2019年 am10. All rights reserved.
8 | //
9 |
10 | import PackageDescription
11 |
12 | let package = Package(name: "AMJpnMap",
13 | platforms: [.iOS(.v9)],
14 | products: [.library(name: "AMJpnMap",
15 | targets: ["AMJpnMap"])],
16 | targets: [.target(name: "AMJpnMap",
17 | path: "Source")],
18 | swiftLanguageVersions: [.v5])
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AMJpnMap
2 |
3 | 
4 | 
5 | [](http://cocoapods.org/pods/AMJpnMap)
6 | [](https://github.com/Carthage/Carthage)
7 | [](https://github.com/apple/swift-package-manager)
8 |
9 | It can display a simple map of Japan.
10 |
11 | ## Demo
12 |
13 | ### AMJpnMapView
14 |
15 | | Fig.1 | Fig.2 |
16 | |---|---|
17 | |||
18 |
19 | ### AMJpnMapDetailView
20 |
21 |
22 |
23 |
24 |
25 | ## Usage
26 |
27 | ### AMJpnMapView
28 |
29 | ```swift
30 | let jpnMapView = AMJpnMapView(frame: view.bounds)
31 | jpnMapView.delegate = self
32 |
33 | // customize here
34 |
35 | view.addSubview(jpnMapView)
36 | ```
37 |
38 | Conform to the protocol in the class implementation.
39 |
40 | ```swift
41 | func jpnMapView(_ jpnMapView: AMJpnMapView, didSelectAtRegion region: AMRegion) {
42 | // use selected region here
43 |
44 | // example 1 (like Fig.1)
45 | jpnMapView.setStrokeColor(color: .black, region: region)
46 | jpnMapView.setScale(scale: 3.0, region: region)
47 |
48 | // example 2 (like Fig.2)
49 | jpnMapView.setFillColor(color: .red, region: region)
50 | jpnMapView.setStrokeColor(color: .red, region: region)
51 | }
52 |
53 | func jpnMapView(_ jpnMapView: AMJpnMapView, didDeselectAtRegion region: AMRegion) {
54 | // use deselected region here
55 |
56 | // example 1 (like Fig.1)
57 | jpnMapView.setStrokeColor(color: .green, region: region)
58 | jpnMapView.setScale(scale: 1.0, region: region)
59 |
60 | // example 2 (like Fig.2)
61 | jpnMapView.setFillColor(color: .green, region: region)
62 | jpnMapView.setStrokeColor(color: .green, region: region)
63 | }
64 | ```
65 |
66 | #### Customization
67 | `AMJpnMapView` can be customized via the following properties.
68 |
69 | ```swift
70 | @IBInspectable public var strokeColor: UIColor = .green
71 | @IBInspectable public var fillColor: UIColor = .green
72 | @IBInspectable public var strokeColorOkinawaLine: UIColor = .black
73 | ```
74 |
75 | ### AMJpnMapDetailView
76 |
77 | ```swift
78 | let jpnMapView = AMJpnMapDetailView(frame: view.bounds)
79 |
80 | // customize here
81 |
82 | view.addSubview(jpnMapView)
83 | ```
84 |
85 | #### Customization
86 | `AMJpnMapDetailView` can be customized via the following properties.
87 |
88 | ```swift
89 | @IBInspectable public var strokeColor: UIColor = .green
90 | @IBInspectable public var fillColor: UIColor = .green
91 | @IBInspectable public var strokeColorOkinawaLine: UIColor = .black
92 | ```
93 |
94 | Set colors.
95 |
96 | ```swift
97 | public func setStrokeColor(color: UIColor, prefecture: AMPrefecture)
98 | public func setFillColor(color: UIColor, prefecture: AMPrefecture)
99 | ```
100 |
101 | ## Installation
102 |
103 | ### CocoaPods
104 |
105 | Add this to your Podfile.
106 |
107 | ```ogdl
108 | pod 'AMJpnMap'
109 | ```
110 |
111 | ### Carthage
112 |
113 | Add this to your Cartfile.
114 |
115 | ```ogdl
116 | github "adventam10/AMJpnMapView"
117 | ```
118 |
119 | ## License
120 |
121 | MIT
122 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0E5805DB2026F29A00500483 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E5805D82026F29A00500483 /* AppDelegate.swift */; };
11 | 0E5805DC2026F29A00500483 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E5805D92026F29A00500483 /* SecondViewController.swift */; };
12 | 0E5805DD2026F29A00500483 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E5805DA2026F29A00500483 /* ViewController.swift */; };
13 | 0E9A08BB2003774B00DD65DB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0E9A08B92003774B00DD65DB /* Main.storyboard */; };
14 | 0E9A08BD2003774B00DD65DB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0E9A08BC2003774B00DD65DB /* Assets.xcassets */; };
15 | 0E9A08C02003774B00DD65DB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0E9A08BE2003774B00DD65DB /* LaunchScreen.storyboard */; };
16 | 0EB234B22354869500442A85 /* AMRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234AC2354869500442A85 /* AMRegion.swift */; };
17 | 0EB234B32354869500442A85 /* AMPrefecture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234AD2354869500442A85 /* AMPrefecture.swift */; };
18 | 0EB234B42354869500442A85 /* AMJpnMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234AE2354869500442A85 /* AMJpnMapView.swift */; };
19 | 0EB234B52354869500442A85 /* AMJpnMapDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234B02354869500442A85 /* AMJpnMapDetailView.swift */; };
20 | 0EB234B62354869500442A85 /* AMJMRegionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB234B12354869500442A85 /* AMJMRegionLayer.swift */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 0E5805D82026F29A00500483 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
25 | 0E5805D92026F29A00500483 /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; };
26 | 0E5805DA2026F29A00500483 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
27 | 0E9A08B22003774B00DD65DB /* SampleAMJpnMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleAMJpnMap.app; sourceTree = BUILT_PRODUCTS_DIR; };
28 | 0E9A08BA2003774B00DD65DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
29 | 0E9A08BC2003774B00DD65DB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
30 | 0E9A08BF2003774B00DD65DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
31 | 0E9A08C12003774B00DD65DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
32 | 0EB234AC2354869500442A85 /* AMRegion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMRegion.swift; sourceTree = ""; };
33 | 0EB234AD2354869500442A85 /* AMPrefecture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMPrefecture.swift; sourceTree = ""; };
34 | 0EB234AE2354869500442A85 /* AMJpnMapView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJpnMapView.swift; sourceTree = ""; };
35 | 0EB234B02354869500442A85 /* AMJpnMapDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJpnMapDetailView.swift; sourceTree = ""; };
36 | 0EB234B12354869500442A85 /* AMJMRegionLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AMJMRegionLayer.swift; sourceTree = ""; };
37 | /* End PBXFileReference section */
38 |
39 | /* Begin PBXFrameworksBuildPhase section */
40 | 0E9A08AF2003774B00DD65DB /* Frameworks */ = {
41 | isa = PBXFrameworksBuildPhase;
42 | buildActionMask = 2147483647;
43 | files = (
44 | );
45 | runOnlyForDeploymentPostprocessing = 0;
46 | };
47 | /* End PBXFrameworksBuildPhase section */
48 |
49 | /* Begin PBXGroup section */
50 | 0E5805D72026F29A00500483 /* Classes */ = {
51 | isa = PBXGroup;
52 | children = (
53 | 0EB234AA2354869500442A85 /* Source */,
54 | 0E5805D82026F29A00500483 /* AppDelegate.swift */,
55 | 0E5805D92026F29A00500483 /* SecondViewController.swift */,
56 | 0E5805DA2026F29A00500483 /* ViewController.swift */,
57 | );
58 | path = Classes;
59 | sourceTree = "";
60 | };
61 | 0E9A08A92003774B00DD65DB = {
62 | isa = PBXGroup;
63 | children = (
64 | 0E9A08B42003774B00DD65DB /* SampleAMJpnMap */,
65 | 0E9A08B32003774B00DD65DB /* Products */,
66 | );
67 | sourceTree = "";
68 | };
69 | 0E9A08B32003774B00DD65DB /* Products */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 0E9A08B22003774B00DD65DB /* SampleAMJpnMap.app */,
73 | );
74 | name = Products;
75 | sourceTree = "";
76 | };
77 | 0E9A08B42003774B00DD65DB /* SampleAMJpnMap */ = {
78 | isa = PBXGroup;
79 | children = (
80 | 0E5805D72026F29A00500483 /* Classes */,
81 | 0E9A08B92003774B00DD65DB /* Main.storyboard */,
82 | 0E9A08BC2003774B00DD65DB /* Assets.xcassets */,
83 | 0E9A08BE2003774B00DD65DB /* LaunchScreen.storyboard */,
84 | 0E9A08C12003774B00DD65DB /* Info.plist */,
85 | );
86 | path = SampleAMJpnMap;
87 | sourceTree = "";
88 | };
89 | 0EB234AA2354869500442A85 /* Source */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 0EB234AB2354869500442A85 /* enums */,
93 | 0EB234AE2354869500442A85 /* AMJpnMapView.swift */,
94 | 0EB234AF2354869500442A85 /* Detail */,
95 | );
96 | name = Source;
97 | path = ../../../Source;
98 | sourceTree = "";
99 | };
100 | 0EB234AB2354869500442A85 /* enums */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 0EB234AC2354869500442A85 /* AMRegion.swift */,
104 | 0EB234AD2354869500442A85 /* AMPrefecture.swift */,
105 | );
106 | path = enums;
107 | sourceTree = "";
108 | };
109 | 0EB234AF2354869500442A85 /* Detail */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 0EB234B02354869500442A85 /* AMJpnMapDetailView.swift */,
113 | 0EB234B12354869500442A85 /* AMJMRegionLayer.swift */,
114 | );
115 | path = Detail;
116 | sourceTree = "";
117 | };
118 | /* End PBXGroup section */
119 |
120 | /* Begin PBXNativeTarget section */
121 | 0E9A08B12003774B00DD65DB /* SampleAMJpnMap */ = {
122 | isa = PBXNativeTarget;
123 | buildConfigurationList = 0E9A08C42003774B00DD65DB /* Build configuration list for PBXNativeTarget "SampleAMJpnMap" */;
124 | buildPhases = (
125 | 0E9A08AE2003774B00DD65DB /* Sources */,
126 | 0E9A08AF2003774B00DD65DB /* Frameworks */,
127 | 0E9A08B02003774B00DD65DB /* Resources */,
128 | );
129 | buildRules = (
130 | );
131 | dependencies = (
132 | );
133 | name = SampleAMJpnMap;
134 | productName = SampleAMJpnMap;
135 | productReference = 0E9A08B22003774B00DD65DB /* SampleAMJpnMap.app */;
136 | productType = "com.apple.product-type.application";
137 | };
138 | /* End PBXNativeTarget section */
139 |
140 | /* Begin PBXProject section */
141 | 0E9A08AA2003774B00DD65DB /* Project object */ = {
142 | isa = PBXProject;
143 | attributes = {
144 | LastSwiftUpdateCheck = 0920;
145 | LastUpgradeCheck = 1020;
146 | ORGANIZATIONNAME = am10;
147 | TargetAttributes = {
148 | 0E9A08B12003774B00DD65DB = {
149 | CreatedOnToolsVersion = 9.2;
150 | LastSwiftMigration = 1020;
151 | ProvisioningStyle = Manual;
152 | };
153 | };
154 | };
155 | buildConfigurationList = 0E9A08AD2003774B00DD65DB /* Build configuration list for PBXProject "SampleAMJpnMap" */;
156 | compatibilityVersion = "Xcode 8.0";
157 | developmentRegion = en;
158 | hasScannedForEncodings = 0;
159 | knownRegions = (
160 | en,
161 | Base,
162 | );
163 | mainGroup = 0E9A08A92003774B00DD65DB;
164 | productRefGroup = 0E9A08B32003774B00DD65DB /* Products */;
165 | projectDirPath = "";
166 | projectRoot = "";
167 | targets = (
168 | 0E9A08B12003774B00DD65DB /* SampleAMJpnMap */,
169 | );
170 | };
171 | /* End PBXProject section */
172 |
173 | /* Begin PBXResourcesBuildPhase section */
174 | 0E9A08B02003774B00DD65DB /* Resources */ = {
175 | isa = PBXResourcesBuildPhase;
176 | buildActionMask = 2147483647;
177 | files = (
178 | 0E9A08C02003774B00DD65DB /* LaunchScreen.storyboard in Resources */,
179 | 0E9A08BD2003774B00DD65DB /* Assets.xcassets in Resources */,
180 | 0E9A08BB2003774B00DD65DB /* Main.storyboard in Resources */,
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | };
184 | /* End PBXResourcesBuildPhase section */
185 |
186 | /* Begin PBXSourcesBuildPhase section */
187 | 0E9A08AE2003774B00DD65DB /* Sources */ = {
188 | isa = PBXSourcesBuildPhase;
189 | buildActionMask = 2147483647;
190 | files = (
191 | 0E5805DD2026F29A00500483 /* ViewController.swift in Sources */,
192 | 0E5805DC2026F29A00500483 /* SecondViewController.swift in Sources */,
193 | 0EB234B42354869500442A85 /* AMJpnMapView.swift in Sources */,
194 | 0EB234B52354869500442A85 /* AMJpnMapDetailView.swift in Sources */,
195 | 0E5805DB2026F29A00500483 /* AppDelegate.swift in Sources */,
196 | 0EB234B32354869500442A85 /* AMPrefecture.swift in Sources */,
197 | 0EB234B62354869500442A85 /* AMJMRegionLayer.swift in Sources */,
198 | 0EB234B22354869500442A85 /* AMRegion.swift in Sources */,
199 | );
200 | runOnlyForDeploymentPostprocessing = 0;
201 | };
202 | /* End PBXSourcesBuildPhase section */
203 |
204 | /* Begin PBXVariantGroup section */
205 | 0E9A08B92003774B00DD65DB /* Main.storyboard */ = {
206 | isa = PBXVariantGroup;
207 | children = (
208 | 0E9A08BA2003774B00DD65DB /* Base */,
209 | );
210 | name = Main.storyboard;
211 | sourceTree = "";
212 | };
213 | 0E9A08BE2003774B00DD65DB /* LaunchScreen.storyboard */ = {
214 | isa = PBXVariantGroup;
215 | children = (
216 | 0E9A08BF2003774B00DD65DB /* Base */,
217 | );
218 | name = LaunchScreen.storyboard;
219 | sourceTree = "";
220 | };
221 | /* End PBXVariantGroup section */
222 |
223 | /* Begin XCBuildConfiguration section */
224 | 0E9A08C22003774B00DD65DB /* Debug */ = {
225 | isa = XCBuildConfiguration;
226 | buildSettings = {
227 | ALWAYS_SEARCH_USER_PATHS = NO;
228 | CLANG_ANALYZER_NONNULL = YES;
229 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
231 | CLANG_CXX_LIBRARY = "libc++";
232 | CLANG_ENABLE_MODULES = YES;
233 | CLANG_ENABLE_OBJC_ARC = YES;
234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
235 | CLANG_WARN_BOOL_CONVERSION = YES;
236 | CLANG_WARN_COMMA = YES;
237 | CLANG_WARN_CONSTANT_CONVERSION = YES;
238 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
241 | CLANG_WARN_EMPTY_BODY = YES;
242 | CLANG_WARN_ENUM_CONVERSION = YES;
243 | CLANG_WARN_INFINITE_RECURSION = YES;
244 | CLANG_WARN_INT_CONVERSION = YES;
245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
246 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
247 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
249 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
250 | CLANG_WARN_STRICT_PROTOTYPES = YES;
251 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
252 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
253 | CLANG_WARN_UNREACHABLE_CODE = YES;
254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
255 | CODE_SIGN_IDENTITY = "iPhone Developer";
256 | COPY_PHASE_STRIP = NO;
257 | DEBUG_INFORMATION_FORMAT = dwarf;
258 | ENABLE_STRICT_OBJC_MSGSEND = YES;
259 | ENABLE_TESTABILITY = YES;
260 | GCC_C_LANGUAGE_STANDARD = gnu11;
261 | GCC_DYNAMIC_NO_PIC = NO;
262 | GCC_NO_COMMON_BLOCKS = YES;
263 | GCC_OPTIMIZATION_LEVEL = 0;
264 | GCC_PREPROCESSOR_DEFINITIONS = (
265 | "DEBUG=1",
266 | "$(inherited)",
267 | );
268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
269 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
270 | GCC_WARN_UNDECLARED_SELECTOR = YES;
271 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
272 | GCC_WARN_UNUSED_FUNCTION = YES;
273 | GCC_WARN_UNUSED_VARIABLE = YES;
274 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
275 | MTL_ENABLE_DEBUG_INFO = YES;
276 | ONLY_ACTIVE_ARCH = YES;
277 | SDKROOT = iphoneos;
278 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
279 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
280 | };
281 | name = Debug;
282 | };
283 | 0E9A08C32003774B00DD65DB /* Release */ = {
284 | isa = XCBuildConfiguration;
285 | buildSettings = {
286 | ALWAYS_SEARCH_USER_PATHS = NO;
287 | CLANG_ANALYZER_NONNULL = YES;
288 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
289 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
290 | CLANG_CXX_LIBRARY = "libc++";
291 | CLANG_ENABLE_MODULES = YES;
292 | CLANG_ENABLE_OBJC_ARC = YES;
293 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
294 | CLANG_WARN_BOOL_CONVERSION = YES;
295 | CLANG_WARN_COMMA = YES;
296 | CLANG_WARN_CONSTANT_CONVERSION = YES;
297 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
299 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
300 | CLANG_WARN_EMPTY_BODY = YES;
301 | CLANG_WARN_ENUM_CONVERSION = YES;
302 | CLANG_WARN_INFINITE_RECURSION = YES;
303 | CLANG_WARN_INT_CONVERSION = YES;
304 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
305 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
306 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
307 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
308 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
309 | CLANG_WARN_STRICT_PROTOTYPES = YES;
310 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
311 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
312 | CLANG_WARN_UNREACHABLE_CODE = YES;
313 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
314 | CODE_SIGN_IDENTITY = "iPhone Developer";
315 | COPY_PHASE_STRIP = NO;
316 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
317 | ENABLE_NS_ASSERTIONS = NO;
318 | ENABLE_STRICT_OBJC_MSGSEND = YES;
319 | GCC_C_LANGUAGE_STANDARD = gnu11;
320 | GCC_NO_COMMON_BLOCKS = YES;
321 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
322 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
323 | GCC_WARN_UNDECLARED_SELECTOR = YES;
324 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
325 | GCC_WARN_UNUSED_FUNCTION = YES;
326 | GCC_WARN_UNUSED_VARIABLE = YES;
327 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
328 | MTL_ENABLE_DEBUG_INFO = NO;
329 | SDKROOT = iphoneos;
330 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
331 | VALIDATE_PRODUCT = YES;
332 | };
333 | name = Release;
334 | };
335 | 0E9A08C52003774B00DD65DB /* Debug */ = {
336 | isa = XCBuildConfiguration;
337 | buildSettings = {
338 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
340 | CODE_SIGN_STYLE = Manual;
341 | DEVELOPMENT_TEAM = "";
342 | INFOPLIST_FILE = SampleAMJpnMap/Info.plist;
343 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
344 | PRODUCT_BUNDLE_IDENTIFIER = am10.SampleAMJpnMap;
345 | PRODUCT_NAME = "$(TARGET_NAME)";
346 | PROVISIONING_PROFILE_SPECIFIER = "";
347 | SWIFT_VERSION = 5.0;
348 | TARGETED_DEVICE_FAMILY = "1,2";
349 | };
350 | name = Debug;
351 | };
352 | 0E9A08C62003774B00DD65DB /* Release */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
357 | CODE_SIGN_STYLE = Manual;
358 | DEVELOPMENT_TEAM = "";
359 | INFOPLIST_FILE = SampleAMJpnMap/Info.plist;
360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
361 | PRODUCT_BUNDLE_IDENTIFIER = am10.SampleAMJpnMap;
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | PROVISIONING_PROFILE_SPECIFIER = "";
364 | SWIFT_VERSION = 5.0;
365 | TARGETED_DEVICE_FAMILY = "1,2";
366 | };
367 | name = Release;
368 | };
369 | /* End XCBuildConfiguration section */
370 |
371 | /* Begin XCConfigurationList section */
372 | 0E9A08AD2003774B00DD65DB /* Build configuration list for PBXProject "SampleAMJpnMap" */ = {
373 | isa = XCConfigurationList;
374 | buildConfigurations = (
375 | 0E9A08C22003774B00DD65DB /* Debug */,
376 | 0E9A08C32003774B00DD65DB /* Release */,
377 | );
378 | defaultConfigurationIsVisible = 0;
379 | defaultConfigurationName = Release;
380 | };
381 | 0E9A08C42003774B00DD65DB /* Build configuration list for PBXNativeTarget "SampleAMJpnMap" */ = {
382 | isa = XCConfigurationList;
383 | buildConfigurations = (
384 | 0E9A08C52003774B00DD65DB /* Debug */,
385 | 0E9A08C62003774B00DD65DB /* Release */,
386 | );
387 | defaultConfigurationIsVisible = 0;
388 | defaultConfigurationName = Release;
389 | };
390 | /* End XCConfigurationList section */
391 | };
392 | rootObject = 0E9A08AA2003774B00DD65DB /* Project object */;
393 | }
394 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Classes/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SampleAMJpnMap
4 | //
5 | // Created by am10 on 2018/01/08.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Classes/SecondViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.swift
3 | // SampleAMJpnMap
4 | //
5 | // Created by am10 on 2018/01/20.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class SecondViewController: UIViewController {
12 |
13 | @IBOutlet weak var detailView: AMJpnMapDetailView!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | // Do any additional setup after loading the view.
19 | detailView.strokeColor = .clear
20 | AMPrefecture.allCases.forEach {
21 | detailView.setFillColor(color: randomColor(alpha: 1.0), prefecture: $0)
22 | }
23 | }
24 |
25 | private func randomColor(alpha: CGFloat) -> UIColor {
26 | let r = CGFloat.random(in: 0...255) / 255.0
27 | let g = CGFloat.random(in: 0...255) / 255.0
28 | let b = CGFloat.random(in: 0...255) / 255.0
29 | return UIColor(red: r, green: g, blue: b, alpha: alpha)
30 | }
31 |
32 | @IBAction private func tappedChangeColorButton(_ sender: Any) {
33 | AMPrefecture.allCases.forEach {
34 | detailView.setFillColor(color: randomColor(alpha: 1.0), prefecture: $0)
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Classes/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // SampleAMJpnMap
4 | //
5 | // Created by am10 on 2018/01/08.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | @IBOutlet weak var jView1: AMJpnMapView!
14 | @IBOutlet weak var jView2: AMJpnMapView!
15 | @IBOutlet weak var jView3: AMJpnMapView!
16 |
17 | override func viewDidLoad() {
18 | super.viewDidLoad()
19 | // Do any additional setup after loading the view, typically from a nib.
20 |
21 | jView1.delegate = self
22 | jView2.delegate = self
23 | }
24 |
25 | override func viewDidAppear(_ animated: Bool) {
26 | super.viewDidAppear(animated)
27 | jView3.setFillColor(color: .blue, region: .hokkaido)
28 | jView3.setFillColor(color: .purple, region: .tohoku)
29 | jView3.setFillColor(color: .red, region: .kanto)
30 | jView3.setFillColor(color: .orange, region: .chubu)
31 | jView3.setFillColor(color: .green, region: .kinki)
32 | jView3.setFillColor(color: .yellow, region: .chugoku)
33 | jView3.setFillColor(color: .magenta, region: .shikoku)
34 | jView3.setFillColor(color: .cyan, region: .kyushu)
35 |
36 | AMRegion.allCases.forEach { jView3.setStrokeColor(color: .clear, region: $0) }
37 | }
38 | }
39 |
40 | extension ViewController: AMJpnMapViewDelegate {
41 | func jpnMapView(_ jpnMapView: AMJpnMapView, didSelectAtRegion region: AMRegion) {
42 | if jpnMapView == jView1 {
43 | jpnMapView.setStrokeColor(color: .black, region: region)
44 | jpnMapView.setScale(scale: 3.0, region: region)
45 | } else {
46 | jpnMapView.setFillColor(color: .red, region: region)
47 | jpnMapView.setStrokeColor(color: .red, region: region)
48 | }
49 | }
50 |
51 | func jpnMapView(_ jpnMapView: AMJpnMapView, didDeselectAtRegion region: AMRegion) {
52 | if jpnMapView == jView1 {
53 | jpnMapView.setStrokeColor(color: .green, region: region)
54 | jpnMapView.setScale(scale: 1.0, region: region)
55 | } else {
56 | jpnMapView.setFillColor(color: .green, region: region)
57 | jpnMapView.setStrokeColor(color: .green, region: region)
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/SampleAMJpnMap/SampleAMJpnMap/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Source/AMJpnMapView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AMJpnMapView.swift
3 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
4 | //
5 | // Created by am10 on 2017/12/29.
6 | // Copyright © 2017年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol AMJpnMapViewDelegate: AnyObject {
12 | func jpnMapView(_ jpnMapView: AMJpnMapView, didSelectAtRegion region: AMRegion)
13 | func jpnMapView(_ jpnMapView: AMJpnMapView, didDeselectAtRegion region: AMRegion)
14 | }
15 |
16 | @IBDesignable public class AMJpnMapView: UIView {
17 |
18 | @IBInspectable public var strokeColor: UIColor = .green
19 | @IBInspectable public var fillColor: UIColor = .green
20 | @IBInspectable public var strokeColorOkinawaLine: UIColor = .black
21 |
22 | weak public var delegate: AMJpnMapViewDelegate?
23 |
24 | override public var bounds: CGRect {
25 | didSet {
26 | mapSize = (frame.width < frame.height) ? frame.width : frame.height
27 | clear()
28 | drawMap()
29 | }
30 | }
31 |
32 | private var mapSize: CGFloat = 0
33 | private var regions: [AMRegion] = [.hokkaido, .tohoku, .kanto, .chubu, .kinki, .chugoku, .shikoku, .kyushu]
34 | private var anchorPoints = [CGPoint]()
35 | private var regionLayers = [CAShapeLayer]()
36 | private var layerOkinawaLine: CAShapeLayer?
37 | private var layerOkinawa: CAShapeLayer?
38 | private var preSelectRegion: AMRegion?
39 |
40 | // MARK:- Initialize
41 | required public init?(coder aDecoder: NSCoder) {
42 | super.init(coder:aDecoder)
43 | initView()
44 | }
45 |
46 | override init(frame: CGRect) {
47 | super.init(frame: frame)
48 | backgroundColor = .clear
49 | initView()
50 | }
51 |
52 | convenience init() {
53 | self.init(frame: .zero)
54 | }
55 |
56 | private func initView() {
57 | let tap = UITapGestureRecognizer(target: self, action: #selector(self.tapAction(gesture:)))
58 | addGestureRecognizer(tap)
59 | }
60 |
61 | override public func draw(_ rect: CGRect) {
62 | mapSize = (rect.width < rect.height) ? rect.width : rect.height
63 | clear()
64 | drawMap()
65 | }
66 |
67 | // MARK:- Gesture Action
68 | @objc func tapAction(gesture: UITapGestureRecognizer) {
69 | let point = gesture.location(in: self)
70 | var isMap = false
71 | for (index, layer) in regionLayers.enumerated() {
72 | let path = UIBezierPath(cgPath: layer.path!)
73 | if path.contains(point) {
74 | isMap = true
75 | deselectLayer()
76 | let region = regions[index]
77 | if preSelectRegion == region {
78 | preSelectRegion = nil
79 | } else {
80 | preSelectRegion = region
81 | layer.zPosition = 1
82 | delegate?.jpnMapView(self, didSelectAtRegion: region)
83 | }
84 | break
85 | }
86 | }
87 |
88 | if !isMap {
89 | deselectLayer()
90 | preSelectRegion = nil
91 | }
92 | }
93 |
94 | private func deselectLayer() {
95 | guard let preSelectRegion = preSelectRegion else {
96 | return
97 | }
98 |
99 | let layer = regionLayers[preSelectRegion.rawValue]
100 | layer.zPosition = -1
101 | delegate?.jpnMapView(self, didDeselectAtRegion: preSelectRegion)
102 | }
103 |
104 | // MARK:- Draw
105 | private func drawMap() {
106 | regions.forEach { region in
107 | let regionLayer = makeLayer(points: region.points.map { makePoint(x: $0.x, y: $0.y) })
108 | regionLayer.strokeColor = strokeColor.cgColor
109 | regionLayer.fillColor = fillColor.cgColor
110 | layer.zPosition = -1
111 | if region == .kyushu {
112 | layerOkinawa = makeOkinawaLayer()
113 | layerOkinawaLine = makeLayerOkinawaLine()
114 | layerOkinawa!.addSublayer(layerOkinawaLine!)
115 | regionLayer.addSublayer(layerOkinawa!)
116 | }
117 | layer.addSublayer(regionLayer)
118 | regionLayers.append(regionLayer)
119 |
120 | let anchorPoint = makeCenterPoint(region.anchorPoints.map { makePoint(x: $0.x, y: $0.y) })
121 | anchorPoints.append(anchorPoint)
122 | }
123 | }
124 |
125 | private func clear() {
126 | anchorPoints.removeAll()
127 | regionLayers.forEach { $0.removeFromSuperlayer() }
128 | regionLayers.removeAll()
129 | layerOkinawa?.removeFromSuperlayer()
130 | layerOkinawaLine?.removeFromSuperlayer()
131 |
132 | layerOkinawa = nil
133 | layerOkinawaLine = nil
134 | }
135 |
136 | private func makeCenterPoint(_ points: [CGPoint]) -> CGPoint {
137 | let centerX = (points[0].x + points[1].x)/2
138 | let centerY = (points[0].y + points[1].y)/2
139 | return CGPoint(x: centerX/frame.width, y: centerY/frame.height)
140 | }
141 |
142 | private func makeOkinawaLayer() -> CAShapeLayer {
143 | let points = AMPrefecture.okinawa.points.map { makePoint(x: $0.x, y: $0.y) }
144 | let okinawaLayer = makeLayer(points: points)
145 | okinawaLayer.strokeColor = strokeColor.cgColor
146 | okinawaLayer.fillColor = fillColor.cgColor
147 | return okinawaLayer
148 | }
149 |
150 | private func makeLayerOkinawaLine() -> CAShapeLayer {
151 | let points = AMPrefecture.okinawa.okinawaLinePoints.map { makePoint(x: $0.x, y: $0.y) }
152 | let linePath = UIBezierPath()
153 | linePath.move(to: points.first!)
154 | points[1.. CAShapeLayer {
164 | let path = UIBezierPath()
165 | path.move(to: points.first!)
166 | points[1.. CGPoint {
176 | return CGPoint(x: mapSize * (x/500.0), y: mapSize * (y/500.0))
177 | }
178 |
179 | private func makeCenterPoint(point1: CGPoint, point2: CGPoint) -> CGPoint {
180 | let centerX = (point1.x + point2.x)/2
181 | let centerY = (point1.y + point2.y)/2
182 | return CGPoint(x: centerX/frame.width, y: centerY/frame.height)
183 | }
184 |
185 | private func regionLayer(for region: AMRegion?) -> CAShapeLayer? {
186 | guard let region = region else {
187 | return nil
188 | }
189 | return regionLayers[region.rawValue]
190 | }
191 |
192 | // MARK:- Public Method
193 | public func setStrokeColor(color: UIColor, region: AMRegion) {
194 | guard let layer = regionLayer(for: region) else {
195 | return
196 | }
197 | layer.strokeColor = color.cgColor
198 | if region == .kyushu {
199 | layerOkinawa?.strokeColor = color.cgColor
200 | }
201 | }
202 |
203 | public func setFillColor(color: UIColor, region: AMRegion) {
204 | guard let layer = regionLayer(for: region) else {
205 | return
206 | }
207 | layer.fillColor = color.cgColor
208 | if region == .kyushu {
209 | layerOkinawa?.fillColor = color.cgColor
210 | }
211 | }
212 |
213 | public func setScale(scale: CGFloat, region: AMRegion) {
214 | guard let layer = regionLayer(for: region) else {
215 | return
216 | }
217 | layer.anchorPoint = (scale == 1.0) ? .init(x: 0.5, y: 0.5) : anchorPoints[region.rawValue]
218 | layer.setAffineTransform(CGAffineTransform(scaleX: scale, y: scale))
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/Source/Detail/AMJMRegionLayer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AMJMRegionLayer.swift
3 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
4 | //
5 | // Created by am10 on 2018/01/20.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class AMJMRegionLayer: CAShapeLayer {
12 |
13 | var region: AMRegion = .hokkaido
14 | var strokeColors: [AMPrefecture: UIColor] = [:]
15 | var fillColors: [AMPrefecture: UIColor] = [:]
16 | var strokeColorOkinawaLine: UIColor = .black {
17 | didSet{
18 | layerOkinawaLine?.strokeColor = strokeColorOkinawaLine.cgColor
19 | }
20 | }
21 |
22 | private var mapSize: CGFloat = 0
23 | private var layerOkinawaLine: CAShapeLayer?
24 | private var prefectureLayers = [CAShapeLayer]()
25 |
26 | private func makeLayer(_ prefecture: AMPrefecture, points: [CGPoint]) -> CAShapeLayer {
27 | let path = UIBezierPath()
28 | path.move(to: points.first!)
29 | points[1.. CGPoint {
41 | return CGPoint(x: mapSize * (x/500.0), y: mapSize * (y/500.0))
42 | }
43 |
44 | private func makeLayerOkinawaLine(points: [CGPoint]) -> CAShapeLayer {
45 | let linePath = UIBezierPath()
46 | linePath.move(to: points.first!)
47 | points[1.. CAShapeLayer? {
57 | guard let index = region.prefectures.firstIndex(of: prefecture) else {
58 | return nil
59 | }
60 | return prefectureLayers[index]
61 | }
62 |
63 | func drawMap(rect: CGRect) {
64 | mapSize = (rect.width < rect.height) ? rect.width : rect.height
65 | frame = rect
66 | region.prefectures.forEach { prefecture in
67 | let layer = makeLayer(prefecture, points: prefecture.points.map { makePoint(x: $0.x, y: $0.y) })
68 | addSublayer(layer)
69 | prefectureLayers.append(layer)
70 | if prefecture == .okinawa {
71 | let points = prefecture.okinawaLinePoints.map { makePoint(x: $0.x, y: $0.y) }
72 | layerOkinawaLine = makeLayerOkinawaLine(points: points)
73 | layer.addSublayer(layerOkinawaLine!)
74 | }
75 | }
76 | }
77 |
78 | func setStrokeColor(color: UIColor, prefecture: AMPrefecture) {
79 | strokeColors[prefecture] = color
80 | prefectureLayer(for: prefecture)?.strokeColor = color.cgColor
81 | }
82 |
83 | func setFillColor(color: UIColor, prefecture: AMPrefecture) {
84 | fillColors[prefecture] = color
85 | prefectureLayer(for: prefecture)?.fillColor = color.cgColor
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Source/Detail/AMJpnMapDetailView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AMJpnMapDetailView.swift
3 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
4 | //
5 | // Created by am10 on 2018/01/18.
6 | // Copyright © 2018年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @IBDesignable public class AMJpnMapDetailView: UIView {
12 |
13 | @IBInspectable public var strokeColor: UIColor = .green {
14 | didSet {
15 | AMPrefecture.allCases.forEach {
16 | strokeColors[$0] = strokeColor
17 | }
18 | }
19 | }
20 | @IBInspectable public var fillColor: UIColor = .green {
21 | didSet {
22 | AMPrefecture.allCases.forEach {
23 | fillColors[$0] = fillColor
24 | }
25 | }
26 | }
27 | @IBInspectable public var strokeColorOkinawaLine: UIColor = .black
28 |
29 | override public var bounds: CGRect {
30 | didSet {
31 | mapSize = (frame.width < frame.height) ? frame.width : frame.height
32 | reloadMap()
33 | }
34 | }
35 |
36 | private var strokeColors: [AMPrefecture: UIColor] = [:]
37 | private var fillColors: [AMPrefecture: UIColor] = [:]
38 | private var mapSize: CGFloat = 0
39 | private var regionLayers = [AMJMRegionLayer]()
40 |
41 | // MARK:- Initialize
42 | required public init?(coder aDecoder: NSCoder) {
43 | super.init(coder:aDecoder)
44 | }
45 |
46 | override init(frame: CGRect) {
47 | super.init(frame: frame)
48 | backgroundColor = .clear
49 | }
50 |
51 | convenience init() {
52 | self.init(frame: .zero)
53 | }
54 |
55 | override public func draw(_ rect: CGRect) {
56 | mapSize = (rect.width < rect.height) ? rect.width : rect.height
57 | reloadMap()
58 | }
59 |
60 | private func reloadMap() {
61 | clear()
62 | drawMap()
63 | }
64 |
65 | // MARK:- Draw
66 | private func drawMap() {
67 | let layerHokkaido = makeRegionLayer(.hokkaido)
68 | regionLayers.append(layerHokkaido)
69 | layer.addSublayer(layerHokkaido)
70 |
71 | let layerTohoku = makeRegionLayer(.tohoku)
72 | regionLayers.append(layerTohoku)
73 | layer.addSublayer(layerTohoku)
74 |
75 | let layerKanto = makeRegionLayer(.kanto)
76 | regionLayers.append(layerKanto)
77 | layer.addSublayer(layerKanto)
78 |
79 | let layerChubu = makeRegionLayer(.chubu)
80 | regionLayers.append(layerChubu)
81 | layer.addSublayer(layerChubu)
82 |
83 | let layerKinki = makeRegionLayer(.kinki)
84 | regionLayers.append(layerKinki)
85 | layer.addSublayer(layerKinki)
86 |
87 | let layerChugoku = makeRegionLayer(.chugoku)
88 | regionLayers.append(layerChugoku)
89 | layer.addSublayer(layerChugoku)
90 |
91 | let layerShikoku = makeRegionLayer(.shikoku)
92 | regionLayers.append(layerShikoku)
93 | layer.addSublayer(layerShikoku)
94 |
95 | let layerKyushu = makeRegionLayer(.kyushu)
96 | regionLayers.append(layerKyushu)
97 | layer.addSublayer(layerKyushu)
98 | }
99 |
100 | private func clear() {
101 | regionLayers.forEach { $0.removeFromSuperlayer() }
102 | regionLayers.removeAll()
103 | }
104 |
105 | private func makeRegionLayer(_ region: AMRegion) -> AMJMRegionLayer {
106 | let regionLayer = AMJMRegionLayer()
107 | regionLayer.region = region
108 | regionLayer.fillColors = fillColors
109 | regionLayer.strokeColors = strokeColors
110 | regionLayer.strokeColorOkinawaLine = strokeColorOkinawaLine
111 | regionLayer.drawMap(rect: bounds)
112 | return regionLayer
113 | }
114 |
115 | private func regionLayer(for prefecture: AMPrefecture) -> AMJMRegionLayer? {
116 | let index = regionLayers.firstIndex { $0.region.prefectures.contains(prefecture) }
117 | return index == nil ? nil : regionLayers[index!]
118 | }
119 |
120 | // MARK:- Public Method
121 | public func setStrokeColor(color: UIColor, prefecture: AMPrefecture) {
122 | strokeColors[prefecture] = color
123 | regionLayer(for: prefecture)?.setStrokeColor(color: color, prefecture: prefecture)
124 | }
125 |
126 | public func setFillColor(color: UIColor, prefecture: AMPrefecture) {
127 | fillColors[prefecture] = color
128 | regionLayer(for: prefecture)?.setFillColor(color: color, prefecture: prefecture)
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/Source/enums/AMPrefecture.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AMPrefecture.swift
3 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
4 | //
5 | // Created by am10 on 2019/10/14.
6 | // Copyright © 2019年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public enum AMPrefecture: CaseIterable {
12 | case hokkaido
13 | case aomori
14 | case iwate
15 | case akita
16 | case miyagi
17 | case yamagata
18 | case fukushima
19 | case ibaraki
20 | case chiba
21 | case tochigi
22 | case gunma
23 | case saitama
24 | case tokyo
25 | case kanagawa
26 | case niigata
27 | case nagano
28 | case yamanashi
29 | case shizuoka
30 | case aichi
31 | case mie
32 | case gifu
33 | case fukui
34 | case ishikawa
35 | case toyama
36 | case shiga
37 | case kyoto
38 | case hyogo
39 | case nara
40 | case wakayama
41 | case osaka
42 | case tottori
43 | case okayama
44 | case hiroshima
45 | case yamaguchi
46 | case shimane
47 | case kagawa
48 | case tokushima
49 | case kochi
50 | case ehime
51 | case fukuoka
52 | case oita
53 | case miyazaki
54 | case kagoshima
55 | case kumamoto
56 | case saga
57 | case nagasaki
58 | case okinawa
59 | }
60 |
61 | extension AMPrefecture {
62 | var points: [CGPoint] {
63 | switch self {
64 | case .hokkaido:
65 | var points = [CGPoint]()
66 | points.append(.init(x: 382, y: 8))
67 | points.append(.init(x: 414, y: 45))
68 | points.append(.init(x: 450, y: 64))
69 | points.append(.init(x: 466, y: 51))
70 | points.append(.init(x: 461, y: 69))
71 | points.append(.init(x: 466, y: 83))
72 | points.append(.init(x: 479, y: 81))
73 | points.append(.init(x: 450, y: 96))
74 | points.append(.init(x: 434, y: 96))
75 | points.append(.init(x: 419, y: 112))
76 | points.append(.init(x: 413, y: 131))
77 | points.append(.init(x: 374, y: 105))
78 | points.append(.init(x: 356, y: 117))
79 | points.append(.init(x: 348, y: 104))
80 | points.append(.init(x: 348, y: 107))
81 | points.append(.init(x: 338, y: 119))
82 | points.append(.init(x: 345, y: 121))
83 | points.append(.init(x: 360, y: 134))
84 | points.append(.init(x: 356, y: 139))
85 | points.append(.init(x: 350, y: 136))
86 | points.append(.init(x: 346, y: 140))
87 | points.append(.init(x: 334, y: 149))
88 | points.append(.init(x: 336, y: 127))
89 | points.append(.init(x: 327, y: 119))
90 | points.append(.init(x: 331, y: 106))
91 | points.append(.init(x: 345, y: 95))
92 | points.append(.init(x: 342, y: 83))
93 | points.append(.init(x: 347, y: 81))
94 | points.append(.init(x: 369, y: 85))
95 | points.append(.init(x: 365, y: 68))
96 | points.append(.init(x: 372, y: 55))
97 | points.append(.init(x: 378, y: 36))
98 | points.append(.init(x: 372, y: 13))
99 | points.append(.init(x: 378, y: 14))
100 | return points
101 | case .aomori:
102 | var points = [CGPoint]()
103 | points.append(.init(x: 356, y: 145))
104 | points.append(.init(x: 362, y: 151))
105 | points.append(.init(x: 371, y: 150))
106 | points.append(.init(x: 369, y: 172))
107 | points.append(.init(x: 373, y: 179))// Iwate・Aomori
108 | points.append(.init(x: 357, y: 184))// Aomori・Iwate・Akita
109 | points.append(.init(x: 358, y: 182))
110 | points.append(.init(x: 352, y: 178))
111 | points.append(.init(x: 345, y: 181))
112 | points.append(.init(x: 332, y: 180))// Akita・Aomori
113 | points.append(.init(x: 331, y: 172))
114 | points.append(.init(x: 339, y: 168))
115 | points.append(.init(x: 341, y: 154))
116 | points.append(.init(x: 344, y: 155))
117 | points.append(.init(x: 349, y: 154))
118 | points.append(.init(x: 351, y: 168))
119 | points.append(.init(x: 353, y: 165))
120 | points.append(.init(x: 355, y: 162))
121 | points.append(.init(x: 362, y: 166))
122 | points.append(.init(x: 363, y: 153))
123 | points.append(.init(x: 352, y: 156))
124 | return points
125 | case .iwate:
126 | var points = [CGPoint]()
127 | points.append(.init(x: 357, y: 184))// Aomori・Iwate・Akita
128 | points.append(.init(x: 373, y: 179))// Iwate・Aomori
129 | points.append(.init(x: 379, y: 184))
130 | points.append(.init(x: 384, y: 206))
131 | points.append(.init(x: 378, y: 225))
132 | points.append(.init(x: 374, y: 230))// Iwate・Miyagi
133 | points.append(.init(x: 370, y: 230))
134 | points.append(.init(x: 364, y: 236))
135 | points.append(.init(x: 360, y: 236))
136 | points.append(.init(x: 353, y: 231))// Iwate・Miyagi・Akita
137 | points.append(.init(x: 349, y: 214))
138 | points.append(.init(x: 353, y: 200))
139 | return points
140 | case .akita:
141 | var points = [CGPoint]()
142 | points.append(.init(x: 332, y: 180))// Akita・Aomori
143 | points.append(.init(x: 345, y: 181))
144 | points.append(.init(x: 352, y: 178))
145 | points.append(.init(x: 358, y: 182))
146 | points.append(.init(x: 357, y: 184))// Aomori・Iwate・Akita
147 | points.append(.init(x: 353, y: 200))
148 | points.append(.init(x: 349, y: 214))
149 | points.append(.init(x: 353, y: 231))// Iwate・Miyagi・Akita
150 | points.append(.init(x: 346, y: 231))// Akita・Yamagata・Miyagi
151 | points.append(.init(x: 341, y: 225))
152 | points.append(.init(x: 328, y: 225))// Akita・Yamagata
153 | points.append(.init(x: 334, y: 207))
154 | points.append(.init(x: 332, y: 198))
155 | points.append(.init(x: 325, y: 200))
156 | points.append(.init(x: 323, y: 196))
157 | points.append(.init(x: 329, y: 193))
158 | return points
159 | case .miyagi:
160 | var points = [CGPoint]()
161 | points.append(.init(x: 374, y: 230))// Iwate・Miyagi
162 | points.append(.init(x: 368, y: 236))
163 | points.append(.init(x: 369, y: 251))
164 | points.append(.init(x: 363, y: 247))
165 | points.append(.init(x: 359, y: 249))
166 | points.append(.init(x: 356, y: 253))
167 | points.append(.init(x: 356, y: 263))// Miyagi・Fukushima
168 | points.append(.init(x: 351, y: 267))
169 | points.append(.init(x: 340, y: 261))// Miyagi・Fukushima・Yamagata
170 | points.append(.init(x: 340, y: 258))
171 | points.append(.init(x: 346, y: 249))
172 | points.append(.init(x: 346, y: 239))
173 | points.append(.init(x: 348, y: 235))
174 | points.append(.init(x: 346, y: 231))// Akita・Yamagata・Miyagi
175 | return points
176 | case .yamagata:
177 | var points = [CGPoint]()
178 | points.append(.init(x: 328, y: 225))// Akita・Yamagata
179 | points.append(.init(x: 341, y: 225))
180 | points.append(.init(x: 346, y: 231))// Akita・Yamagata・Miyagi
181 | points.append(.init(x: 348, y: 235))
182 | points.append(.init(x: 346, y: 239))
183 | points.append(.init(x: 346, y: 249))
184 | points.append(.init(x: 340, y: 258))
185 |
186 | points.append(.init(x: 340, y: 261))// Miyagi・Fukushima・Yamagata
187 | points.append(.init(x: 338, y: 267))
188 | points.append(.init(x: 329, y: 266))
189 | points.append(.init(x: 326, y: 266))// Yamagata・Fukushima・Niigata
190 | points.append(.init(x: 325, y: 261))
191 | points.append(.init(x: 328, y: 249))
192 | points.append(.init(x: 322, y: 242))// Yamagata・Niigata
193 | points.append(.init(x: 328, y: 230))
194 | return points
195 | case .fukushima:
196 | var points = [CGPoint]()
197 | points.append(.init(x: 356, y: 263))// Miyagi・Fukushima
198 | points.append(.init(x: 358, y: 273))
199 | points.append(.init(x: 355, y: 292))// Fukushima・Ibaraki
200 | points.append(.init(x: 347, y: 296))
201 | points.append(.init(x: 346, y: 297))
202 | points.append(.init(x: 340, y: 296))//Fukushima・Ibaraki・Tochigi
203 | points.append(.init(x: 337, y: 294))
204 | points.append(.init(x: 337, y: 290))
205 | points.append(.init(x: 329, y: 286))
206 | points.append(.init(x: 321, y: 292))
207 | points.append(.init(x: 321, y: 292))//Fukushima・Gunma・Tochigi
208 | points.append(.init(x: 313, y: 292))//Fukushima・Niigata・Gunma
209 | points.append(.init(x: 312, y: 277))
210 | points.append(.init(x: 321, y: 275))
211 | points.append(.init(x: 326, y: 266))// Yamagata・Fukushima・Niigata
212 | points.append(.init(x: 329, y: 266))
213 | points.append(.init(x: 338, y: 267))
214 | points.append(.init(x: 340, y: 261))// Miyagi・Fukushima・Yamagata
215 | points.append(.init(x: 351, y: 267))
216 | return points
217 | case .ibaraki:
218 | var points = [CGPoint]()
219 | points.append(.init(x: 340, y: 296))//Fukushima・Ibaraki・Tochigi
220 | points.append(.init(x: 346, y: 297))
221 | points.append(.init(x: 347, y: 296))
222 | points.append(.init(x: 355, y: 292))//Fukushima・Ibaraki
223 | points.append(.init(x: 345, y: 315))
224 | points.append(.init(x: 353, y: 331))// Ibaraki・Chiba
225 | points.append(.init(x: 344, y: 325))
226 | points.append(.init(x: 338, y: 327))
227 | points.append(.init(x: 326, y: 320))// Ibaraki・Chiba・Saitama
228 | points.append(.init(x: 323, y: 317))// Ibaraki・Tochigi・Saitama
229 | points.append(.init(x: 329, y: 312))
230 | points.append(.init(x: 338, y: 308))
231 | return points
232 | case .chiba:
233 | var points = [CGPoint]()
234 | points.append(.init(x: 326, y: 320))// Ibaraki・Chiba・Saitama
235 | points.append(.init(x: 338, y: 327))
236 | points.append(.init(x: 344, y: 325))
237 | points.append(.init(x: 353, y: 331))// Ibaraki・Chiba
238 | points.append(.init(x: 343, y: 335))
239 | points.append(.init(x: 343, y: 347))
240 | points.append(.init(x: 327, y: 355))
241 | points.append(.init(x: 327, y: 343))
242 | points.append(.init(x: 334, y: 338))
243 | points.append(.init(x: 333, y: 333))
244 | points.append(.init(x: 329, y: 334))// Tokyo・Chiba
245 | points.append(.init(x: 328, y: 327))// Tokyo・Chiba・Saitama
246 | return points
247 | case .tochigi:
248 | var points = [CGPoint]()
249 | points.append(.init(x: 321, y: 292))//Fukushima・Gunma・Tochigi
250 | points.append(.init(x: 329, y: 286))
251 | points.append(.init(x: 337, y: 290))
252 | points.append(.init(x: 337, y: 294))
253 | points.append(.init(x: 340, y: 296))//Fukushima・Ibaraki・Tochigi
254 | points.append(.init(x: 338, y: 308))
255 | points.append(.init(x: 329, y: 312))
256 | points.append(.init(x: 323, y: 317))// Ibaraki・Tochigi・Saitama
257 | points.append(.init(x: 321, y: 317))//Saitama・Gunma・Tochigi
258 | points.append(.init(x: 317, y: 311))
259 | points.append(.init(x: 318, y: 304))
260 | points.append(.init(x: 314, y: 302))
261 | return points
262 | case .gunma:
263 | var points = [CGPoint]()
264 | points.append(.init(x: 300, y: 321))// Saitama・Gunma・Nagano
265 | points.append(.init(x: 297, y: 319))
266 | points.append(.init(x: 298, y: 309))
267 | points.append(.init(x: 292, y: 306))// Gunma・Nagano・Niigata
268 | points.append(.init(x: 303, y: 297))
269 | points.append(.init(x: 308, y: 291))
270 | points.append(.init(x: 313, y: 292))//Fukushima・Gunma・Niigata
271 | points.append(.init(x: 321, y: 292))//Fukushima・Gunma・Tochigi
272 | points.append(.init(x: 314, y: 302))
273 | points.append(.init(x: 318, y: 304))
274 | points.append(.init(x: 317, y: 311))
275 | points.append(.init(x: 321, y: 317))//Saitama・Gunma・Tochigi
276 | points.append(.init(x: 311, y: 313))
277 | points.append(.init(x: 308, y: 317))
278 | return points
279 | case .saitama:
280 | var points = [CGPoint]()
281 | points.append(.init(x: 300, y: 321))// Saitama・Gunma・Nagano
282 | points.append(.init(x: 308, y: 317))
283 | points.append(.init(x: 311, y: 313))
284 | points.append(.init(x: 321, y: 317))//Saitama・Gunma・Tochigi
285 | points.append(.init(x: 323, y: 317))// Ibaraki・Tochigi・Saitama
286 | points.append(.init(x: 326, y: 320))// Ibaraki・Chiba・Saitama
287 | points.append(.init(x: 328, y: 327))// Tokyo・Chiba・Saitama
288 | points.append(.init(x: 317, y: 329))
289 | points.append(.init(x: 310, y: 326))
290 | points.append(.init(x: 306, y: 327))// Tokyo・Saitama・Yamanashi
291 | points.append(.init(x: 297, y: 323))// Saitama・Yamanashi・Nagano
292 | return points
293 | case .tokyo:
294 | var points = [CGPoint]()
295 | points.append(.init(x: 306, y: 327))// Tokyo・Saitama・Yamanashi
296 | points.append(.init(x: 310, y: 326))
297 | points.append(.init(x: 317, y: 329))
298 | points.append(.init(x: 328, y: 327))// Tokyo・Chiba・Saitama
299 | points.append(.init(x: 329, y: 334))// Tokyo・Chiba
300 | points.append(.init(x: 327, y: 335))// Tokyo・Kanagawa
301 | points.append(.init(x: 320, y: 334))
302 | points.append(.init(x: 320, y: 335))
303 | points.append(.init(x: 312, y: 332))// Tokyo・Kanagawa・Yamanashi
304 | return points
305 | case .kanagawa:
306 | var points = [CGPoint]()
307 | points.append(.init(x: 312, y: 332))// Tokyo・Kanagawa・Yamanashi
308 | points.append(.init(x: 320, y: 335))
309 | points.append(.init(x: 320, y: 334))
310 | points.append(.init(x: 327, y: 335))// Tokyo・Kanagawa
311 | points.append(.init(x: 324, y: 342))
312 | points.append(.init(x: 326, y: 346))
313 | points.append(.init(x: 322, y: 349))
314 | points.append(.init(x: 321, y: 345))
315 | points.append(.init(x: 312, y: 345))
316 | points.append(.init(x: 308, y: 350))// Kanagawa・Shizuoka
317 | points.append(.init(x: 308, y: 343))
318 | points.append(.init(x: 305, y: 341))
319 | points.append(.init(x: 310, y: 334))// Kanagawa・Shizuoka・Yamanashi
320 | return points
321 | case .niigata:
322 | var points = [CGPoint]()
323 | points.append(.init(x: 322, y: 242))// Yamagata・Niigata
324 | points.append(.init(x: 328, y: 249))
325 | points.append(.init(x: 325, y: 261))
326 | points.append(.init(x: 326, y: 266))// Yamagata・Fukushima・Niigata
327 | points.append(.init(x: 321, y: 275))
328 | points.append(.init(x: 312, y: 277))
329 | points.append(.init(x: 313, y: 292))//Fukushima・Gunma・Niigata
330 | points.append(.init(x: 308, y: 291))
331 | points.append(.init(x: 303, y: 297))
332 | points.append(.init(x: 292, y: 306))// Gunma・Nagano・Niigata
333 | points.append(.init(x: 295, y: 292))
334 | points.append(.init(x: 285, y: 296))
335 | points.append(.init(x: 280, y: 294))
336 | points.append(.init(x: 276, y: 297))// Niigata・Toyama・Nagano
337 | points.append(.init(x: 274, y: 291))// Niigata・Toyama
338 | points.append(.init(x: 292, y: 282))
339 | points.append(.init(x: 302, y: 266))
340 | points.append(.init(x: 313, y: 259))
341 | return points
342 | case .nagano:
343 | var points = [CGPoint]()
344 | points.append(.init(x: 273, y: 309))// Nagano・Toyama
345 | points.append(.init(x: 276, y: 297))// Niigata・Toyama・Nagano
346 | points.append(.init(x: 280, y: 294))
347 | points.append(.init(x: 285, y: 296))
348 | points.append(.init(x: 295, y: 292))
349 | points.append(.init(x: 292, y: 306))// Gunma・Nagano・Niigata
350 | points.append(.init(x: 298, y: 309))
351 | points.append(.init(x: 297, y: 319))
352 | points.append(.init(x: 300, y: 321))// Saitama・Gunma・Nagano
353 | points.append(.init(x: 297, y: 323))// Saitama・Yamanashi・Nagano
354 | points.append(.init(x: 292, y: 324))
355 | points.append(.init(x: 288, y: 326))
356 | points.append(.init(x: 288, y: 336))// Nagano・Yamanashi・Shizuoka
357 | points.append(.init(x: 284, y: 340))
358 | points.append(.init(x: 276, y: 347))//Nagano・Shizuoka・Aichi
359 | points.append(.init(x: 270, y: 345))// Nagano・Aichi・Gifu
360 | points.append(.init(x: 269, y: 333))
361 | points.append(.init(x: 265, y: 326))
362 | points.append(.init(x: 271, y: 323))
363 | points.append(.init(x: 272, y: 310))// Nagano・Gifu・Toyama
364 | return points
365 | case .yamanashi:
366 | var points = [CGPoint]()
367 | points.append(.init(x: 288, y: 336))// Nagano・Yamanashi・Shizuoka
368 | points.append(.init(x: 288, y: 326))
369 | points.append(.init(x: 292, y: 324))
370 | points.append(.init(x: 297, y: 323))// Saitama・Yamanashi・Nagano
371 | points.append(.init(x: 306, y: 327))// Tokyo・Saitama・Yamanashi
372 | points.append(.init(x: 312, y: 332))// Kanagawa・Tokyo・Yamanashi
373 | points.append(.init(x: 310, y: 334))// Kanagawa・Shizuoka・Yamanashi
374 | points.append(.init(x: 297, y: 342))
375 | points.append(.init(x: 294, y: 345))
376 | points.append(.init(x: 292, y: 347))
377 | points.append(.init(x: 289, y: 341))
378 | return points
379 | case .shizuoka:
380 | var points = [CGPoint]()
381 | points.append(.init(x: 310, y: 334))// Kanagawa・Shizuoka・Yamanashi
382 | points.append(.init(x: 305, y: 341))
383 | points.append(.init(x: 308, y: 343))
384 | points.append(.init(x: 308, y: 350))// Kanagawa・Shizuoka
385 | points.append(.init(x: 311, y: 355))
386 | points.append(.init(x: 304, y: 365))
387 | points.append(.init(x: 300, y: 362))
388 | points.append(.init(x: 300, y: 354))
389 | points.append(.init(x: 305, y: 351))
390 | points.append(.init(x: 297, y: 349))
391 | points.append(.init(x: 284, y: 365))
392 | points.append(.init(x: 270, y: 364))// Aichi・Shizuoka
393 | points.append(.init(x: 268, y: 358))
394 | points.append(.init(x: 276, y: 347))//Nagano・Shizuoka・Aichi
395 | points.append(.init(x: 284, y: 340))
396 | points.append(.init(x: 288, y: 336))// Nagano・Yamanashi・Shizuoka
397 | points.append(.init(x: 289, y: 341))
398 | points.append(.init(x: 292, y: 347))
399 | points.append(.init(x: 294, y: 345))
400 | points.append(.init(x: 297, y: 342))
401 | return points
402 | case .aichi:
403 | var points = [CGPoint]()
404 | points.append(.init(x: 270, y: 345))// Nagano・Aichi・Gifu
405 | points.append(.init(x: 276, y: 347))//Nagano・Shizuoka・Aichi
406 | points.append(.init(x: 268, y: 358))
407 | points.append(.init(x: 270, y: 364))// Aichi・Shizuoka
408 | points.append(.init(x: 258, y: 366))
409 | points.append(.init(x: 265, y: 361))
410 | points.append(.init(x: 259, y: 360))
411 | points.append(.init(x: 256, y: 359))
412 | points.append(.init(x: 257, y: 363))
413 | points.append(.init(x: 252, y: 360))
414 | points.append(.init(x: 253, y: 353))
415 | points.append(.init(x: 250, y: 351))// Aichi・Mie
416 | points.append(.init(x: 249, y: 347))// Aichi・Mie・Gifu
417 | points.append(.init(x: 251, y: 342))
418 | points.append(.init(x: 255, y: 341))
419 | points.append(.init(x: 262, y: 344))
420 | return points
421 | case .mie:
422 | var points = [CGPoint]()
423 | points.append(.init(x: 249, y: 347))// Aichi・Mie・Gifu
424 | points.append(.init(x: 250, y: 351))// Aichi・Mie
425 | points.append(.init(x: 244, y: 363))
426 | points.append(.init(x: 254, y: 369))
427 | points.append(.init(x: 253, y: 375))
428 | points.append(.init(x: 240, y: 378))
429 | points.append(.init(x: 239, y: 383))
430 | points.append(.init(x: 231, y: 391))//Wakayama・Mie
431 | points.append(.init(x: 228, y: 387))// Wakayama・Mie・Nara
432 | points.append(.init(x: 234, y: 381))
433 | points.append(.init(x: 233, y: 372))
434 | points.append(.init(x: 237, y: 370))
435 | points.append(.init(x: 232, y: 361))// Kyoto・Mie・Nara
436 | points.append(.init(x: 234, y: 360))// Kyoto・Mie・Shiga
437 | points.append(.init(x: 244, y: 347))
438 | points.append(.init(x: 242, y: 346))// Gifu・Mie・Shiga
439 | return points
440 | case .gifu:
441 | var points = [CGPoint]()
442 | points.append(.init(x: 272, y: 310))// Nagano・Gifu・Toyama
443 | points.append(.init(x: 271, y: 323))
444 | points.append(.init(x: 265, y: 326))
445 | points.append(.init(x: 269, y: 333))
446 | points.append(.init(x: 270, y: 345))// Nagano・Aichi・Gifu
447 | points.append(.init(x: 262, y: 344))
448 | points.append(.init(x: 255, y: 341))
449 | points.append(.init(x: 251, y: 342))
450 | points.append(.init(x: 249, y: 347))// Aichi・Mie・Gifu
451 | points.append(.init(x: 242, y: 346))// Gifu・Mie・Shiga
452 | points.append(.init(x: 239, y: 333))// Gifu・Fukui・Shiga
453 | points.append(.init(x: 242, y: 330))
454 | points.append(.init(x: 251, y: 327))
455 | points.append(.init(x: 249, y: 321))
456 | points.append(.init(x: 250, y: 317))// Gifu・Fukui・Ishikawa
457 | points.append(.init(x: 252, y: 310))// Gifu・Toyama・Ishikawa
458 | points.append(.init(x: 258, y: 313))
459 | points.append(.init(x: 261, y: 309))
460 | return points
461 | case .fukui:
462 | var points = [CGPoint]()
463 | points.append(.init(x: 238, y: 313))// Fukui・Ishikawa
464 | points.append(.init(x: 244, y: 317))
465 | points.append(.init(x: 250, y: 317))// Gifu・Fukui・Ishikawa
466 | points.append(.init(x: 249, y: 321))
467 | points.append(.init(x: 251, y: 327))
468 | points.append(.init(x: 242, y: 330))
469 | points.append(.init(x: 239, y: 333))// Gifu・Fukui・Shiga
470 | points.append(.init(x: 228, y: 338))
471 | points.append(.init(x: 225, y: 343))// Kyoto・Fukui・Shiga
472 | points.append(.init(x: 222, y: 343))
473 | points.append(.init(x: 215, y: 339))// Kyoto・Fukui
474 | points.append(.init(x: 222, y: 337))
475 | points.append(.init(x: 233, y: 330))
476 | points.append(.init(x: 228, y: 323))
477 | return points
478 | case .ishikawa:
479 | var points = [CGPoint]()
480 | points.append(.init(x: 238, y: 313))// Fukui・Ishikawa
481 | points.append(.init(x: 255, y: 290))
482 | points.append(.init(x: 249, y: 282))
483 | points.append(.init(x: 265, y: 274))
484 | points.append(.init(x: 264, y: 281))
485 | points.append(.init(x: 258, y: 284))
486 | points.append(.init(x: 258, y: 291))// Ishikawa・Toyama
487 | points.append(.init(x: 254, y: 296))
488 | points.append(.init(x: 252, y: 310))// Gifu・Toyama・Ishikawa
489 | points.append(.init(x: 250, y: 317))// Gifu・Fukui・Ishikawa
490 | points.append(.init(x: 244, y: 317))
491 | return points
492 | case .toyama:
493 | var points = [CGPoint]()
494 | points.append(.init(x: 258, y: 291))// Ishikawa・Toyama
495 | points.append(.init(x: 258, y: 297))
496 | points.append(.init(x: 266, y: 298))
497 | points.append(.init(x: 266, y: 293))
498 | points.append(.init(x: 274, y: 291))// Niigata・Toyama
499 | points.append(.init(x: 276, y: 297))// Niigata・Toyama・Nagano
500 | points.append(.init(x: 272, y: 310))// Nagano・Gifu・Toyama
501 | points.append(.init(x: 261, y: 309))
502 | points.append(.init(x: 258, y: 313))
503 | points.append(.init(x: 252, y: 310))// Gifu・Toyama・Ishikawa
504 | points.append(.init(x: 254, y: 296))
505 | return points
506 | case .shiga:
507 | var points = [CGPoint]()
508 | points.append(.init(x: 225, y: 343))// Kyoto・Fukui・Shiga
509 | points.append(.init(x: 228, y: 338))
510 | points.append(.init(x: 239, y: 333))// Gifu・Fukui・Shiga
511 | points.append(.init(x: 242, y: 346))// Gifu・Mie・Shiga
512 | points.append(.init(x: 244, y: 347))
513 | points.append(.init(x: 234, y: 360))// Kyoto・Mie・Shiga
514 | points.append(.init(x: 229, y: 353))
515 | return points
516 | case .kyoto:
517 | var points = [CGPoint]()
518 | points.append(.init(x: 215, y: 339))// Kyoto・Fukui
519 | points.append(.init(x: 222, y: 343))
520 | points.append(.init(x: 225, y: 343))// Kyoto・Fukui・Shiga
521 | points.append(.init(x: 229, y: 353))
522 | points.append(.init(x: 234, y: 360))// Kyoto・Mie・Shiga
523 | points.append(.init(x: 232, y: 361))// Kyoto・Mie・Nara
524 | points.append(.init(x: 225, y: 360))// Kyoto・Osaka・Nara
525 | points.append(.init(x: 225, y: 355))// Kyoto・Osaka・Hyogo
526 | points.append(.init(x: 217, y: 349))
527 | points.append(.init(x: 204, y: 342))
528 | points.append(.init(x: 208, y: 337))
529 | points.append(.init(x: 203, y: 334))//Kyoto・Hyogo
530 | points.append(.init(x: 211, y: 329))
531 | points.append(.init(x: 215, y: 332))
532 | points.append(.init(x: 214, y: 336))
533 | return points
534 | case .hyogo:
535 | var points = [CGPoint]()
536 | points.append(.init(x: 190, y: 334))// Tottori・Hyogo
537 | points.append(.init(x: 203, y: 334))//Kyoto・Hyogo
538 | points.append(.init(x: 208, y: 337))
539 | points.append(.init(x: 204, y: 342))
540 | points.append(.init(x: 217, y: 349))
541 | points.append(.init(x: 225, y: 355))// Kyoto・Osaka・Hyogo
542 | points.append(.init(x: 218, y: 362))//Osaka・Hyogo
543 | points.append(.init(x: 212, y: 362))
544 | points.append(.init(x: 205, y: 365))
545 | points.append(.init(x: 198, y: 360))
546 | points.append(.init(x: 186, y: 360))// Hyogo・Okayama
547 | points.append(.init(x: 192, y: 345))// Tottori・Hyogo・Okayama
548 | points.append(.init(x: 194, y: 343))
549 | return points
550 | case .nara:
551 | var points = [CGPoint]()
552 | points.append(.init(x: 232, y: 361))// Kyoto・Mie・Nara
553 | points.append(.init(x: 237, y: 370))
554 | points.append(.init(x: 233, y: 372))
555 | points.append(.init(x: 234, y: 381))
556 | points.append(.init(x: 228, y: 387))// Wakayama・Mie・Nara
557 | points.append(.init(x: 225, y: 387))
558 | points.append(.init(x: 220, y: 381))
559 | points.append(.init(x: 225, y: 376))
560 | points.append(.init(x: 225, y: 372))// Wakayama・Osaka・Nara
561 | points.append(.init(x: 225, y: 360))// Kyoto・Osaka・Nara
562 | return points
563 | case .wakayama:
564 | var points = [CGPoint]()
565 | points.append(.init(x: 211, y: 372))//Wakayama・Osaka
566 | points.append(.init(x: 225, y: 372))// Wakayama・Osaka・Nara
567 | points.append(.init(x: 225, y: 376))
568 | points.append(.init(x: 220, y: 381))
569 | points.append(.init(x: 225, y: 387))
570 | points.append(.init(x: 228, y: 387))// Wakayama・Mie・Nara
571 | points.append(.init(x: 231, y: 391))//Wakayama・Mie
572 | points.append(.init(x: 225, y: 401))
573 | points.append(.init(x: 216, y: 397))
574 | points.append(.init(x: 217, y: 390))
575 | points.append(.init(x: 209, y: 385))
576 | points.append(.init(x: 209, y: 374))
577 | return points
578 | case .osaka:
579 | var points = [CGPoint]()
580 | points.append(.init(x: 225, y: 355))// Kyoto・Osaka・Hyogo
581 | points.append(.init(x: 225, y: 360))// Kyoto・Osaka・Nara
582 | points.append(.init(x: 225, y: 372))// Wakayama・Osaka・Nara
583 | points.append(.init(x: 211, y: 372))//Wakayama・Osaka
584 | points.append(.init(x: 217, y: 366))
585 | points.append(.init(x: 218, y: 362))//Osaka・Hyogo
586 | return points
587 | case .tottori:
588 | var points = [CGPoint]()
589 | points.append(.init(x: 165, y: 340))// Tottori・Shimane
590 | points.append(.init(x: 170, y: 337))
591 | points.append(.init(x: 182, y: 338))
592 | points.append(.init(x: 190, y: 334))// Tottori・Hyogo
593 | points.append(.init(x: 194, y: 343))
594 | points.append(.init(x: 192, y: 345))// Tottori・Hyogo・Okayama
595 | points.append(.init(x: 185, y: 346))
596 | points.append(.init(x: 178, y: 345))
597 | points.append(.init(x: 170, y: 343))
598 | points.append(.init(x: 164, y: 351))// Tottori・Hiroshima・Okayama
599 | points.append(.init(x: 159, y: 349))// Tottori・Hiroshima・Shimane
600 | points.append(.init(x: 164, y: 342))
601 | return points
602 | case .okayama:
603 | var points = [CGPoint]()
604 | points.append(.init(x: 192, y: 345))// Tottori・Hyogo・Okayama
605 | points.append(.init(x: 186, y: 360))// Hyogo・Okayama
606 | points.append(.init(x: 177, y: 370))
607 | points.append(.init(x: 169, y: 368))// Okayama・Hiroshima
608 | points.append(.init(x: 165, y: 358))
609 | points.append(.init(x: 164, y: 351))// Tottori・Hiroshima・Okayama
610 | points.append(.init(x: 170, y: 343))
611 | points.append(.init(x: 178, y: 345))
612 | points.append(.init(x: 185, y: 346))
613 | return points
614 | case .hiroshima:
615 | var points = [CGPoint]()
616 | points.append(.init(x: 159, y: 349))// Tottori・Hiroshima・Shimane
617 | points.append(.init(x: 164, y: 351))// Tottori・Hiroshima・Okayama
618 | points.append(.init(x: 165, y: 358))
619 | points.append(.init(x: 169, y: 368))// Okayama・Hiroshima
620 | points.append(.init(x: 166, y: 369))
621 | points.append(.init(x: 145, y: 377))
622 | points.append(.init(x: 142, y: 371))
623 | points.append(.init(x: 139, y: 377))// Hiroshima・Yamaguchi
624 | points.append(.init(x: 136, y: 374))
625 | points.append(.init(x: 133, y: 370))// Hiroshima・Yamaguchi・Shimane
626 | points.append(.init(x: 138, y: 360))
627 | points.append(.init(x: 147, y: 357))
628 | points.append(.init(x: 152, y: 350))
629 | return points
630 | case .yamaguchi:
631 | var points = [CGPoint]()
632 | points.append(.init(x: 133, y: 370))// Hiroshima・Yamaguchi・Shimane
633 | points.append(.init(x: 136, y: 374))
634 | points.append(.init(x: 139, y: 377))// Hiroshima・Yamaguchi
635 | points.append(.init(x: 138, y: 376))
636 | points.append(.init(x: 137, y: 383))
637 | points.append(.init(x: 131, y: 388))
638 | points.append(.init(x: 124, y: 381))
639 | points.append(.init(x: 112, y: 385))
640 | points.append(.init(x: 104, y: 384))
641 | points.append(.init(x: 106, y: 370))
642 | points.append(.init(x: 114, y: 372))
643 | points.append(.init(x: 123, y: 363))// Shimane・Yamaguchi
644 | points.append(.init(x: 123, y: 369))
645 | points.append(.init(x: 129, y: 374))
646 | return points
647 | case .shimane:
648 | var points = [CGPoint]()
649 | points.append(.init(x: 123, y: 363))// Shimane・Yamaguchi
650 | points.append(.init(x: 147, y: 343))
651 | points.append(.init(x: 163, y: 335))
652 | points.append(.init(x: 164, y: 338))
653 | points.append(.init(x: 165, y: 340))// Tottori・Shimane
654 | points.append(.init(x: 164, y: 342))
655 | points.append(.init(x: 159, y: 349))// Tottori・Hiroshima・Shimane
656 | points.append(.init(x: 152, y: 350))
657 | points.append(.init(x: 147, y: 357))
658 | points.append(.init(x: 138, y: 360))
659 | points.append(.init(x: 133, y: 370))// Hiroshima・Yamaguchi・Shimane
660 | points.append(.init(x: 129, y: 374))
661 | points.append(.init(x: 123, y: 369))
662 | return points
663 | case .kagawa:
664 | var points = [CGPoint]()
665 | points.append(.init(x: 172, y: 382))// Kagawa・Ehime
666 | points.append(.init(x: 171, y: 375))
667 | points.append(.init(x: 184, y: 373))
668 | points.append(.init(x: 187, y: 375))
669 | points.append(.init(x: 194, y: 377))// Kagawa・Tokushima
670 | points.append(.init(x: 182, y: 380))
671 | points.append(.init(x: 174, y: 384))// Kagawa・Tokushima・Ehime
672 | return points
673 | case .tokushima:
674 | var points = [CGPoint]()
675 | points.append(.init(x: 194, y: 377))// Kagawa・Tokushima
676 | points.append(.init(x: 197, y: 377))
677 | points.append(.init(x: 200, y: 389))
678 | points.append(.init(x: 189, y: 397))
679 | points.append(.init(x: 188, y: 398))// Tokushima・Kochi
680 | points.append(.init(x: 181, y: 390))
681 | points.append(.init(x: 173, y: 388))// Tokushima・Kochi・Ehime
682 | points.append(.init(x: 174, y: 384))// Kagawa・Tokushima・Ehime
683 | points.append(.init(x: 182, y: 380))
684 | return points
685 | case .kochi:
686 | var points = [CGPoint]()
687 | points.append(.init(x: 173, y: 388))// Tokushima・Kochi・Ehime
688 | points.append(.init(x: 181, y: 390))
689 | points.append(.init(x: 188, y: 398))// Tokushima・Kochi
690 | points.append(.init(x: 186, y: 406))
691 | points.append(.init(x: 178, y: 399))
692 | points.append(.init(x: 167, y: 400))
693 | points.append(.init(x: 151, y: 421))
694 | points.append(.init(x: 146, y: 415))// Kochi・Ehime
695 | points.append(.init(x: 154, y: 400))
696 | points.append(.init(x: 162, y: 390))
697 | return points
698 | case .ehime:
699 | var points = [CGPoint]()
700 | points.append(.init(x: 172, y: 382))// Kagawa・Ehime
701 | points.append(.init(x: 174, y: 384))// Kagawa・Tokushima・Ehime
702 | points.append(.init(x: 173, y: 388))// Tokushima・Kochi・Ehime
703 | points.append(.init(x: 162, y: 390))
704 | points.append(.init(x: 154, y: 400))
705 | points.append(.init(x: 146, y: 415))// Kochi・Ehime
706 | points.append(.init(x: 143, y: 417))
707 | points.append(.init(x: 143, y: 404))
708 | points.append(.init(x: 132, y: 403))
709 | points.append(.init(x: 148, y: 393))
710 | points.append(.init(x: 155, y: 380))
711 | points.append(.init(x: 158, y: 385))
712 | return points
713 | case .fukuoka:
714 | var points = [CGPoint]()
715 | points.append(.init(x: 111, y: 397))// Fukuoka・Oita
716 | points.append(.init(x: 103, y: 401))
717 | points.append(.init(x: 104, y: 410))// Fukuoka・Oita・Kumamoto
718 | points.append(.init(x: 93, y: 413))// Kumamoto・Fukuoka
719 | points.append(.init(x: 91, y: 411))
720 | points.append(.init(x: 88, y: 407))// Fukuoka・Saga
721 | points.append(.init(x: 95, y: 401))
722 | points.append(.init(x: 83, y: 398))// Fukuoka・Saga
723 | points.append(.init(x: 103, y: 385))
724 | points.append(.init(x: 105, y: 391))
725 | return points
726 | case .oita:
727 | var points = [CGPoint]()
728 | points.append(.init(x: 111, y: 397))// Fukuoka・Oita
729 | points.append(.init(x: 122, y: 393))
730 | points.append(.init(x: 127, y: 398))
731 | points.append(.init(x: 118, y: 405))
732 | points.append(.init(x: 130, y: 407))
733 | points.append(.init(x: 133, y: 416))
734 | points.append(.init(x: 129, y: 421))// Oita・Miyazaki
735 | points.append(.init(x: 114, y: 418))// Oita・Miyazaki・Kumamoto
736 | points.append(.init(x: 110, y: 409))
737 | points.append(.init(x: 108, y: 408))
738 | points.append(.init(x: 108, y: 412))
739 | points.append(.init(x: 104, y: 410))// Fukuoka・Oita・Kumamoto
740 | points.append(.init(x: 103, y: 401))
741 | points.append(.init(x: 111, y: 397))// Fukuoka・Oita
742 | return points
743 | case .miyazaki:
744 | var points = [CGPoint]()
745 | points.append(.init(x: 114, y: 418))// Oita・Miyazaki・Kumamoto
746 | points.append(.init(x: 129, y: 421))// Oita・Miyazaki
747 | points.append(.init(x: 124, y: 425))
748 | points.append(.init(x: 119, y: 437))
749 | points.append(.init(x: 114, y: 462))
750 | points.append(.init(x: 110, y: 457))// Miyazaki・Kagoshima
751 | points.append(.init(x: 111, y: 455))
752 | points.append(.init(x: 104, y: 450))
753 | points.append(.init(x: 100, y: 442))// Miyazaki・Kagoshima・Kumamoto
754 | points.append(.init(x: 110, y: 436))
755 | points.append(.init(x: 107, y: 428))
756 | return points
757 | case .kagoshima:
758 | var points = [CGPoint]()
759 | points.append(.init(x: 100, y: 442))// Miyazaki・Kagoshima・Kumamoto
760 | points.append(.init(x: 104, y: 450))
761 | points.append(.init(x: 111, y: 455))
762 | points.append(.init(x: 110, y: 457))// Miyazaki・Kagoshima
763 | points.append(.init(x: 98, y: 472))
764 | points.append(.init(x: 98, y: 456))
765 | points.append(.init(x: 101, y: 456))
766 | points.append(.init(x: 101, y: 450))
767 | points.append(.init(x: 97, y: 450))
768 | points.append(.init(x: 94, y: 462))
769 | points.append(.init(x: 98, y: 467))
770 | points.append(.init(x: 83, y: 462))
771 | points.append(.init(x: 90, y: 458))
772 | points.append(.init(x: 85, y: 450))
773 | points.append(.init(x: 84, y: 436))
774 | points.append(.init(x: 88, y: 437))// Kumamoto・Kagoshima
775 | points.append(.init(x: 95, y: 437))
776 | return points
777 | case .kumamoto:
778 | var points = [CGPoint]()
779 | points.append(.init(x: 93, y: 413))// Kumamoto・Fukuoka
780 | points.append(.init(x: 104, y: 410))// Fukuoka・Oita・Kumamoto
781 | points.append(.init(x: 108, y: 412))
782 | points.append(.init(x: 108, y: 408))
783 | points.append(.init(x: 110, y: 409))
784 | points.append(.init(x: 114, y: 418))// Oita・Miyazaki・Kumamoto
785 | points.append(.init(x: 107, y: 428))
786 | points.append(.init(x: 110, y: 436))
787 | points.append(.init(x: 100, y: 442))// Miyazaki・Kagoshima・Kumamoto
788 | points.append(.init(x: 95, y: 437))
789 | points.append(.init(x: 88, y: 437))// Kumamoto・Kagoshima
790 | points.append(.init(x: 89, y: 428))
791 | points.append(.init(x: 95, y: 420))
792 | points.append(.init(x: 96, y: 414))
793 | return points
794 | case .saga:
795 | var points = [CGPoint]()
796 | points.append(.init(x: 76, y: 402))// Saga・Nagasaki
797 | points.append(.init(x: 78, y: 397))
798 | points.append(.init(x: 83, y: 398))// Fukuoka・Saga
799 | points.append(.init(x: 95, y: 401))
800 | points.append(.init(x: 88, y: 407))// Fukuoka・Saga
801 | points.append(.init(x: 85, y: 415))// Saga・Nagasaki
802 | return points
803 | case .nagasaki:
804 | var points = [CGPoint]()
805 | points.append(.init(x: 76, y: 402))// Saga・Nagasaki
806 | points.append(.init(x: 85, y: 415))// Saga・Nagasaki
807 | points.append(.init(x: 83, y: 418))
808 | points.append(.init(x: 83, y: 419))
809 | points.append(.init(x: 85, y: 420))
810 | points.append(.init(x: 91, y: 421))
811 | points.append(.init(x: 86, y: 426))
812 | points.append(.init(x: 85, y: 422))
813 | points.append(.init(x: 76, y: 425))
814 | points.append(.init(x: 76, y: 420))
815 | points.append(.init(x: 72, y: 410))
816 | points.append(.init(x: 69, y: 406))
817 | points.append(.init(x: 72, y: 402))
818 | return points
819 | case .okinawa:
820 | var points = [CGPoint]()
821 | points.append(.init(x: 52, y: 469))
822 | points.append(.init(x: 52, y: 473))
823 | points.append(.init(x: 38, y: 481))
824 | points.append(.init(x: 36, y: 490))
825 | points.append(.init(x: 32, y: 491))
826 | points.append(.init(x: 31, y: 489))
827 | points.append(.init(x: 34, y: 481))
828 | points.append(.init(x: 42, y: 477))
829 | points.append(.init(x: 39, y: 474))
830 | points.append(.init(x: 39, y: 473))
831 | points.append(.init(x: 42, y: 472))
832 | points.append(.init(x: 43, y: 475))
833 | points.append(.init(x: 50, y: 468))
834 | return points
835 | }
836 | }
837 |
838 | var okinawaLinePoints: [CGPoint] {
839 | if self != .okinawa {
840 | return []
841 | }
842 | return [.init(x: 21, y: 456), .init(x: 62, y: 456), .init(x: 62, y: 496)]
843 | }
844 | }
845 |
--------------------------------------------------------------------------------
/Source/enums/AMRegion.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AMRegion.swift
3 | // AMJpnMap, https://github.com/adventam10/AMJpnMapView
4 | //
5 | // Created by am10 on 2019/10/14.
6 | // Copyright © 2019年 am10. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public enum AMRegion: Int, CaseIterable {
12 | case hokkaido = 0
13 | case tohoku = 1
14 | case kanto = 2
15 | case chubu = 3
16 | case kinki = 4
17 | case chugoku = 5
18 | case shikoku = 6
19 | case kyushu = 7
20 |
21 | var prefectures: [AMPrefecture] {
22 | switch self {
23 | case .hokkaido:
24 | return [.hokkaido]
25 | case .tohoku:
26 | return [.aomori, .iwate, .akita, .miyagi, .yamagata, .fukushima]
27 | case .kanto:
28 | return [.ibaraki, .chiba, .tochigi, .gunma, .saitama, .tokyo, .kanagawa]
29 | case .chubu:
30 | return [.niigata, .nagano, .yamanashi, .shizuoka, .aichi, .mie, .gifu, .fukui, .ishikawa, .toyama]
31 | case .kinki:
32 | return [.shiga, .kyoto, .hyogo, .nara, .wakayama, .osaka]
33 | case .chugoku:
34 | return [.tottori, .okayama, .hiroshima, .yamaguchi, .shimane]
35 | case .shikoku:
36 | return [.kagawa, .tokushima, .kochi, .ehime]
37 | case .kyushu:
38 | return [.fukuoka, .oita, .miyazaki, .kagoshima, .kumamoto, .saga, .nagasaki, .okinawa]
39 | }
40 | }
41 | }
42 |
43 | extension AMRegion {
44 | var points: [CGPoint] {
45 | switch self {
46 | case .hokkaido:
47 | var points = [CGPoint]()
48 | points.append(.init(x: 382, y: 8))
49 | points.append(.init(x: 414, y: 45))
50 | points.append(.init(x: 450, y: 64))
51 | points.append(.init(x: 466, y: 51))
52 | points.append(.init(x: 461, y: 69))
53 | points.append(.init(x: 466, y: 83))
54 | points.append(.init(x: 479, y: 81))
55 | points.append(.init(x: 450, y: 96))
56 | points.append(.init(x: 434, y: 96))
57 | points.append(.init(x: 419, y: 112))
58 | points.append(.init(x: 413, y: 131))
59 | points.append(.init(x: 374, y: 105))
60 | points.append(.init(x: 356, y: 117))
61 | points.append(.init(x: 348, y: 104))
62 | points.append(.init(x: 348, y: 107))
63 | points.append(.init(x: 338, y: 119))
64 | points.append(.init(x: 345, y: 121))
65 | points.append(.init(x: 360, y: 134))
66 | points.append(.init(x: 356, y: 139))
67 | points.append(.init(x: 350, y: 136))
68 | points.append(.init(x: 346, y: 140))
69 | points.append(.init(x: 334, y: 149))
70 | points.append(.init(x: 336, y: 127))
71 | points.append(.init(x: 327, y: 119))
72 | points.append(.init(x: 331, y: 106))
73 | points.append(.init(x: 345, y: 95))
74 | points.append(.init(x: 342, y: 83))
75 | points.append(.init(x: 347, y: 81))
76 | points.append(.init(x: 369, y: 85))
77 | points.append(.init(x: 365, y: 68))
78 | points.append(.init(x: 372, y: 55))
79 | points.append(.init(x: 378, y: 36))
80 | points.append(.init(x: 372, y: 13))
81 | points.append(.init(x: 378, y: 14))
82 | return points
83 | case .tohoku:
84 | var points = [CGPoint]()
85 | points.append(.init(x: 356, y: 145))
86 | points.append(.init(x: 362, y: 151))
87 | points.append(.init(x: 371, y: 150))
88 | points.append(.init(x: 369, y: 172))
89 | points.append(.init(x: 373, y: 179))// Aomori・Iwate
90 | points.append(.init(x: 379, y: 184))
91 | points.append(.init(x: 384, y: 206))
92 | points.append(.init(x: 378, y: 225))
93 | points.append(.init(x: 374, y: 230))// Iwate・Miyagi
94 | points.append(.init(x: 368, y: 236))
95 | points.append(.init(x: 369, y: 251))
96 | points.append(.init(x: 363, y: 247))
97 | points.append(.init(x: 359, y: 249))
98 | points.append(.init(x: 356, y: 253))
99 | points.append(.init(x: 356, y: 263))// Miyagi・Fukushima
100 | points.append(.init(x: 358, y: 273))
101 | /// point of contact with Kanto
102 | points.append(.init(x: 355, y: 292))//Fukushima・Ibaraki
103 | points.append(.init(x: 347, y: 296))
104 | points.append(.init(x: 346, y: 297))
105 | points.append(.init(x: 340, y: 296))//Fukushima・Ibaraki・Tochigi
106 | points.append(.init(x: 337, y: 294))
107 | points.append(.init(x: 337, y: 290))
108 | points.append(.init(x: 329, y: 286))
109 | points.append(.init(x: 321, y: 292))//Fukushima・Gunma・Tochigi
110 | /// point of contact with Kanto, Chubu
111 | points.append(.init(x: 313, y: 292))//Fukushima・Gunma・Niigata
112 | /// point of contact with Chubu
113 | points.append(.init(x: 312, y: 277))
114 | points.append(.init(x: 321, y: 275))
115 | points.append(.init(x: 326, y: 266))// Yamagata・Fukushima・Niigata
116 | points.append(.init(x: 325, y: 261))
117 | points.append(.init(x: 328, y: 249))
118 | points.append(.init(x: 322, y: 242))// Yamagata・Niigata
119 | points.append(.init(x: 328, y: 230))
120 | points.append(.init(x: 328, y: 225))// Akita・Yamagata
121 | points.append(.init(x: 334, y: 207))
122 | points.append(.init(x: 332, y: 198))
123 | points.append(.init(x: 325, y: 200))
124 | points.append(.init(x: 323, y: 196))
125 | points.append(.init(x: 329, y: 193))
126 | points.append(.init(x: 332, y: 180))// Aomori・Akita
127 | points.append(.init(x: 331, y: 172))
128 | points.append(.init(x: 339, y: 168))
129 | points.append(.init(x: 341, y: 154))
130 | points.append(.init(x: 344, y: 155))
131 | points.append(.init(x: 349, y: 154))
132 | points.append(.init(x: 351, y: 168))
133 | points.append(.init(x: 353, y: 165))
134 | points.append(.init(x: 355, y: 162))
135 | points.append(.init(x: 362, y: 166))
136 | points.append(.init(x: 363, y: 153))
137 | points.append(.init(x: 352, y: 156))
138 | return points
139 | case .kanto:
140 | var points = [CGPoint]()
141 | /// point of contact with Tohoku, Chubu
142 | points.append(.init(x: 313, y: 292))//Fukushima・Gunma・Niigata
143 | /// point of contact with Tohoku
144 | points.append(.init(x: 321, y: 292))//Fukushima・Gunma・Tochigi
145 | points.append(.init(x: 329, y: 286))
146 | points.append(.init(x: 337, y: 290))
147 | points.append(.init(x: 337, y: 294))
148 | points.append(.init(x: 340, y: 296))//Fukushima・Ibaraki・Tochigi
149 | points.append(.init(x: 346, y: 297))
150 | points.append(.init(x: 347, y: 296))
151 | points.append(.init(x: 355, y: 292))//Fukushima・Ibaraki
152 | points.append(.init(x: 345, y: 315))
153 | points.append(.init(x: 353, y: 331))
154 | points.append(.init(x: 343, y: 335))
155 | points.append(.init(x: 343, y: 347))
156 | points.append(.init(x: 327, y: 355))
157 | points.append(.init(x: 327, y: 343))
158 | points.append(.init(x: 334, y: 338))
159 | points.append(.init(x: 333, y: 333))
160 | points.append(.init(x: 329, y: 334))// Tokyo・Chiba
161 | points.append(.init(x: 327, y: 335))// Tokyo・Kanagawa
162 | points.append(.init(x: 324, y: 342))
163 | points.append(.init(x: 326, y: 346))
164 | points.append(.init(x: 322, y: 349))
165 | points.append(.init(x: 321, y: 345))
166 | points.append(.init(x: 312, y: 345))
167 | /// point of contact with Chubu
168 | points.append(.init(x: 308, y: 350))// Kanagawa・Shizuoka
169 | points.append(.init(x: 308, y: 343))
170 | points.append(.init(x: 305, y: 341))
171 | points.append(.init(x: 310, y: 334))// Kanagawa・Shizuoka・Yamanashi
172 | points.append(.init(x: 312, y: 332))// Kanagawa・Tokyo・Yamanashi
173 | points.append(.init(x: 306, y: 327))// Tokyo・Saitama・Yamanashi
174 | points.append(.init(x: 297, y: 323))// Saitama・Yamanashi・Nagano
175 | points.append(.init(x: 300, y: 321))// Saitama・Gunma・Nagano
176 | points.append(.init(x: 297, y: 319))
177 | points.append(.init(x: 298, y: 309))
178 | points.append(.init(x: 292, y: 306))// Gunma・Nagano・Niigata
179 | points.append(.init(x: 303, y: 297))
180 | points.append(.init(x: 308, y: 291))
181 | return points
182 | case .chubu:
183 | var points = [CGPoint]()
184 | /// point of contact with Tohoku
185 | points.append(.init(x: 322, y: 242))// Yamagata・Niigata
186 | points.append(.init(x: 328, y: 249))
187 | points.append(.init(x: 325, y: 261))
188 | points.append(.init(x: 326, y: 266))// Yamagata・Fukushima・Niigata
189 | points.append(.init(x: 321, y: 275))
190 | points.append(.init(x: 312, y: 277))
191 | /// point of contact with Tohoku, Chubu
192 | points.append(.init(x: 313, y: 292))//Fukushima・Gunma・Niigata
193 | //// point of contact with Kanto
194 | points.append(.init(x: 308, y: 291))
195 | points.append(.init(x: 303, y: 297))
196 | points.append(.init(x: 292, y: 306))// Gunma・Nagano・Niigata
197 | points.append(.init(x: 298, y: 309))
198 | points.append(.init(x: 297, y: 319))
199 | points.append(.init(x: 300, y: 321))// Saitama・Gunma・Nagano
200 | points.append(.init(x: 297, y: 323))// Saitama・Yamanashi・Nagano
201 | points.append(.init(x: 306, y: 327))// Tokyo・Saitama・Yamanashi
202 | points.append(.init(x: 312, y: 332))// Kanagawa・Tokyo・Yamanashi
203 | points.append(.init(x: 310, y: 334))// Kanagawa・Shizuoka・Yamanashi
204 | points.append(.init(x: 305, y: 341))
205 | points.append(.init(x: 308, y: 343))
206 | points.append(.init(x: 308, y: 350))// Kanagawa・Shizuoka
207 | points.append(.init(x: 311, y: 355))
208 | points.append(.init(x: 304, y: 365))
209 | points.append(.init(x: 300, y: 362))
210 | points.append(.init(x: 300, y: 354))
211 | points.append(.init(x: 305, y: 351))
212 | points.append(.init(x: 297, y: 349))
213 | points.append(.init(x: 284, y: 365))
214 | points.append(.init(x: 270, y: 364))// Aichi・Shizuoka
215 | points.append(.init(x: 258, y: 366))
216 | points.append(.init(x: 265, y: 361))
217 | points.append(.init(x: 259, y: 360))
218 | points.append(.init(x: 256, y: 359))
219 | points.append(.init(x: 257, y: 363))
220 | points.append(.init(x: 252, y: 360))
221 | points.append(.init(x: 253, y: 353))
222 | points.append(.init(x: 250, y: 351))// Aichi・Mie
223 | points.append(.init(x: 244, y: 363))
224 | points.append(.init(x: 254, y: 369))
225 | points.append(.init(x: 253, y: 375))
226 | points.append(.init(x: 240, y: 378))
227 | points.append(.init(x: 239, y: 383))
228 | /// point of contact with Kinki
229 | points.append(.init(x: 231, y: 391))//Wakayama・Mie
230 | points.append(.init(x: 228, y: 387))// Wakayama・Mie・Nara
231 | points.append(.init(x: 234, y: 381))
232 | points.append(.init(x: 233, y: 372))
233 | points.append(.init(x: 237, y: 370))
234 | points.append(.init(x: 232, y: 361))// Kyoto・Mie・Nara
235 | points.append(.init(x: 234, y: 360))// Kyoto・Mie・Shiga
236 | points.append(.init(x: 244, y: 347))
237 | points.append(.init(x: 242, y: 346))// Gifu・Mie・Shiga
238 | points.append(.init(x: 239, y: 333))// Gifu・Fukui・Shiga
239 | points.append(.init(x: 228, y: 338))
240 | points.append(.init(x: 225, y: 343))// Kyoto・Fukui・Shiga
241 | points.append(.init(x: 222, y: 343))
242 | points.append(.init(x: 215, y: 339))// Kyoto・Fukui
243 | points.append(.init(x: 222, y: 337))
244 | points.append(.init(x: 233, y: 330))
245 | points.append(.init(x: 228, y: 323))
246 | points.append(.init(x: 238, y: 313))// Fukui・Ishikawa
247 | points.append(.init(x: 255, y: 290))
248 | points.append(.init(x: 249, y: 282))
249 | points.append(.init(x: 265, y: 274))
250 | points.append(.init(x: 264, y: 281))
251 | points.append(.init(x: 258, y: 284))
252 | points.append(.init(x: 258, y: 291))// Ishikawa・Toyama
253 | points.append(.init(x: 258, y: 297))
254 | points.append(.init(x: 266, y: 298))
255 | points.append(.init(x: 266, y: 293))
256 | points.append(.init(x: 274, y: 291))// Niigata・Toyama
257 | points.append(.init(x: 292, y: 282))
258 | points.append(.init(x: 302, y: 266))
259 | points.append(.init(x: 313, y: 259))
260 | return points
261 | case .kinki:
262 | var points = [CGPoint]()
263 | // point of contact with Chubu
264 | points.append(.init(x: 215, y: 339))// Kyoto・Fukui
265 | points.append(.init(x: 222, y: 343))
266 | points.append(.init(x: 225, y: 343))// Kyoto・Fukui・Shiga
267 | points.append(.init(x: 228, y: 338))
268 | points.append(.init(x: 239, y: 333))// Gifu・Fukui・Shiga
269 | points.append(.init(x: 242, y: 346))// Gifu・Mie・Shiga
270 | points.append(.init(x: 244, y: 347))
271 | points.append(.init(x: 234, y: 360))// Kyoto・Mie・Shiga
272 | points.append(.init(x: 232, y: 361))// Kyoto・Mie・Nara
273 | points.append(.init(x: 237, y: 370))
274 | points.append(.init(x: 233, y: 372))
275 | points.append(.init(x: 234, y: 381))
276 | points.append(.init(x: 228, y: 387))// Wakayama・Mie・Nara
277 | points.append(.init(x: 231, y: 391))//Wakayama・Mie
278 | points.append(.init(x: 225, y: 401))
279 | points.append(.init(x: 216, y: 397))
280 | points.append(.init(x: 217, y: 390))
281 | points.append(.init(x: 209, y: 385))
282 | points.append(.init(x: 209, y: 374))
283 | points.append(.init(x: 211, y: 372))//Wakayama・Osaka
284 | points.append(.init(x: 217, y: 366))
285 | points.append(.init(x: 218, y: 362))//Osaka・Hyogo
286 | points.append(.init(x: 212, y: 362))
287 | points.append(.init(x: 205, y: 365))
288 | points.append(.init(x: 198, y: 360))
289 | // point of contact with Chugoku
290 | points.append(.init(x: 186, y: 360))// Hyogo・Okayama
291 | points.append(.init(x: 192, y: 345))// Tottori・Hyogo・Okayama
292 | points.append(.init(x: 194, y: 343))
293 | points.append(.init(x: 190, y: 334))// Tottori・Hyogo
294 | points.append(.init(x: 203, y: 334))//Kyoto・Hyogo
295 | points.append(.init(x: 211, y: 329))
296 | points.append(.init(x: 215, y: 332))
297 | points.append(.init(x: 214, y: 336))
298 | return points
299 | case .chugoku:
300 | var points = [CGPoint]()
301 | /// point of contact with Kinki
302 | points.append(.init(x: 190, y: 334))// Tottori・Hyogo
303 | points.append(.init(x: 194, y: 343))
304 | points.append(.init(x: 192, y: 345))// Tottori・Hyogo・Okayama
305 | points.append(.init(x: 186, y: 360))// Hyogo・Okayama
306 | points.append(.init(x: 177, y: 370))
307 | points.append(.init(x: 169, y: 368))// Okayama・Hiroshima
308 | points.append(.init(x: 166, y: 369))
309 | points.append(.init(x: 145, y: 377))
310 | points.append(.init(x: 142, y: 371))
311 | points.append(.init(x: 139, y: 377))// Hiroshima・Yamaguchi
312 | points.append(.init(x: 138, y: 376))
313 | points.append(.init(x: 137, y: 383))
314 | points.append(.init(x: 131, y: 388))
315 | points.append(.init(x: 124, y: 381))
316 | points.append(.init(x: 112, y: 385))
317 | points.append(.init(x: 104, y: 384))
318 | points.append(.init(x: 106, y: 370))
319 | points.append(.init(x: 114, y: 372))
320 | points.append(.init(x: 123, y: 363))// Shimane・Yamaguchi
321 | points.append(.init(x: 147, y: 343))
322 | points.append(.init(x: 163, y: 335))
323 | points.append(.init(x: 164, y: 338))
324 | points.append(.init(x: 165, y: 340))// Tottori・Shimane
325 | points.append(.init(x: 170, y: 337))
326 | points.append(.init(x: 182, y: 338))
327 | return points
328 | case .shikoku:
329 | var points = [CGPoint]()
330 | points.append(.init(x: 184, y: 373))
331 | points.append(.init(x: 187, y: 375))
332 | points.append(.init(x: 194, y: 377))// Kagawa・Tokushima
333 | points.append(.init(x: 197, y: 377))
334 | points.append(.init(x: 200, y: 389))
335 | points.append(.init(x: 189, y: 397))
336 | points.append(.init(x: 188, y: 398))// Tokushima・Kochi
337 | points.append(.init(x: 186, y: 406))
338 | points.append(.init(x: 178, y: 399))
339 | points.append(.init(x: 167, y: 400))
340 | points.append(.init(x: 151, y: 421))
341 | points.append(.init(x: 146, y: 415))// Kochi・Ehime
342 | points.append(.init(x: 143, y: 417))
343 | points.append(.init(x: 143, y: 404))
344 | points.append(.init(x: 132, y: 403))
345 | points.append(.init(x: 148, y: 393))
346 | points.append(.init(x: 155, y: 380))
347 | points.append(.init(x: 158, y: 385))
348 | points.append(.init(x: 172, y: 382))// Kagawa・Ehime
349 | points.append(.init(x: 171, y: 375))
350 | return points
351 | case .kyushu:
352 | var points = [CGPoint]()
353 | points.append(.init(x: 103, y: 385))
354 | points.append(.init(x: 105, y: 391))
355 | points.append(.init(x: 111, y: 397))// Fukuoka・Oita
356 | points.append(.init(x: 122, y: 393))
357 | points.append(.init(x: 127, y: 398))
358 | points.append(.init(x: 118, y: 405))
359 | points.append(.init(x: 130, y: 407))
360 | points.append(.init(x: 133, y: 416))
361 | points.append(.init(x: 129, y: 421))// Oita・Miyazaki
362 | points.append(.init(x: 124, y: 425))
363 | points.append(.init(x: 119, y: 437))
364 | points.append(.init(x: 114, y: 462))
365 | points.append(.init(x: 110, y: 457))// Miyazaki・Kagoshima
366 | points.append(.init(x: 98, y: 472))
367 | points.append(.init(x: 98, y: 456))
368 | points.append(.init(x: 101, y: 456))
369 | points.append(.init(x: 101, y: 450))
370 | points.append(.init(x: 97, y: 450))
371 | points.append(.init(x: 94, y: 462))
372 | points.append(.init(x: 98, y: 467))
373 | points.append(.init(x: 83, y: 462))
374 | points.append(.init(x: 90, y: 458))
375 | points.append(.init(x: 85, y: 450))
376 | points.append(.init(x: 84, y: 436))
377 | points.append(.init(x: 88, y: 437))// Kumamoto・Kagoshima
378 | points.append(.init(x: 89, y: 428))
379 | points.append(.init(x: 95, y: 420))
380 | points.append(.init(x: 96, y: 414))
381 | points.append(.init(x: 93, y: 413))// Kumamoto・Fukuoka
382 | points.append(.init(x: 91, y: 411))
383 | points.append(.init(x: 88, y: 407))// Fukuoka・Saga
384 | points.append(.init(x: 85, y: 415))// Saga・Nagasaki
385 | points.append(.init(x: 83, y: 418))
386 | points.append(.init(x: 83, y: 419))
387 | points.append(.init(x: 85, y: 420))
388 | points.append(.init(x: 91, y: 421))
389 | points.append(.init(x: 86, y: 426))
390 | points.append(.init(x: 85, y: 422))
391 | points.append(.init(x: 76, y: 425))
392 | points.append(.init(x: 76, y: 420))
393 | points.append(.init(x: 72, y: 410))
394 | points.append(.init(x: 69, y: 406))
395 | points.append(.init(x: 72, y: 402))
396 | points.append(.init(x: 76, y: 402))// Saga・Nagasaki
397 | points.append(.init(x: 78, y: 397))
398 | points.append(.init(x: 83, y: 398))// Fukuoka・Saga
399 | return points
400 | }
401 | }
402 |
403 | var anchorPoints: [CGPoint] {
404 | switch self {
405 | case .hokkaido:
406 | return [.init(x: 382, y: 8), .init(x: 413, y: 131)]
407 | case .tohoku:
408 | return [.init(x: 356, y: 145), .init(x: 329, y: 286)]
409 | case .kanto:
410 | return [.init(x: 329, y: 286), .init(x: 327, y: 355)]
411 | case .chubu:
412 | return [.init(x: 322, y: 242), .init(x: 231, y: 391)]
413 | case .kinki:
414 | return [.init(x: 215, y: 339), .init(x: 231, y: 391)]
415 | case .chugoku:
416 | return [.init(x: 194, y: 343), .init(x: 104, y: 384)]
417 | case .shikoku:
418 | return [.init(x: 197, y: 377), .init(x: 143, y: 404)]
419 | case .kyushu:
420 | return [.init(x: 103, y: 385), .init(x: 98, y: 472)]
421 | }
422 | }
423 | }
424 |
--------------------------------------------------------------------------------