From 1f89bfbc6d345cc51e80e077f5dbe4d836dde731 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 10 Dec 2025 23:21:25 +0000
Subject: [PATCH 1/4] Initial plan
From 121a70bfe887a261221331743f3af59ae1120934 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 10 Dec 2025 23:30:43 +0000
Subject: [PATCH 2/4] feat: implement county map popup feature with built-in
data
- Add CountyMapPopup component with full interactivity
- Add showCountyMapOnClick prop to enable county map display
- Add countyData prop for providing county information
- Add countyMapWrapper prop for custom popup styling
- Add onCountyClick callback for county interactions
- Include sample county data for Istanbul, Ankara, and Izmir
- Export county data separately for tree-shaking support
- Add comprehensive test coverage for new features
- Update README with county map usage examples
Co-authored-by: erdigokce <17235148+erdigokce@users.noreply.github.com>
---
readme.md | 83 +++++++++
src/CountyMapPopup.tsx | 238 ++++++++++++++++++++++++++
src/__tests__/CountyMapPopup.test.tsx | 189 ++++++++++++++++++++
src/__tests__/TurkeyMap.test.tsx | 196 +++++++++++++++++++++
src/data/counties/ankara.ts | 133 ++++++++++++++
src/data/counties/index.ts | 10 ++
src/data/counties/istanbul.ts | 203 ++++++++++++++++++++++
src/data/counties/izmir.ts | 153 +++++++++++++++++
src/index.tsx | 63 ++++++-
9 files changed, 1262 insertions(+), 6 deletions(-)
create mode 100644 src/CountyMapPopup.tsx
create mode 100644 src/__tests__/CountyMapPopup.test.tsx
create mode 100644 src/data/counties/ankara.ts
create mode 100644 src/data/counties/index.ts
create mode 100644 src/data/counties/istanbul.ts
create mode 100644 src/data/counties/izmir.ts
diff --git a/readme.md b/readme.md
index 31bf033..e11c2bf 100644
--- a/readme.md
+++ b/readme.md
@@ -87,6 +87,83 @@ in other words :
{ id: string, plateNumber: number, name: string, path: string }[]
```
+### County Map Feature
+
+When enabled, clicking on a city displays a popup showing the county (ilçe) map of that city. This feature:
+- Must be explicitly enabled via `showCountyMapOnClick` prop
+- Requires county data to be imported separately to keep bundle size small when not used
+- Can be customized via `countyMapWrapper` prop
+- Supports all the same interaction handlers as the main map
+
+#### Basic Usage
+
+```javascript
+import TurkeyMap from 'turkey-map-react';
+import { istanbulCounties, ankaraCounties } from 'turkey-map-react/lib/data/counties';
+
+// Import only the county data you need
+const countyData = {
+ istanbul: istanbulCounties,
+ ankara: ankaraCounties
+};
+
+
+```
+
+#### Handling County Events
+
+```javascript
+ {
+ console.log(`${county.name} in ${city.name} was clicked!`);
+ }}
+/>
+```
+
+#### Custom County Map Wrapper
+
+```javascript
+const customCountyMapWrapper = (countyMapPopup, city, countyData) => (
+