Skip to content

Commit 200f195

Browse files
committed
Lat Long Path
1 parent f2ac245 commit 200f195

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.eslintcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"D:\\ultimateakash\\react-google-maps\\src\\index.js":"1","D:\\ultimateakash\\react-google-maps\\src\\App.js":"2","D:\\ultimateakash\\react-google-maps\\src\\reportWebVitals.js":"3","D:\\ultimateakash\\react-google-maps\\src\\components\\map.component.jsx":"4"},{"size":500,"mtime":499162500000,"results":"5","hashOfConfig":"6"},{"size":251,"mtime":1649183518322,"results":"7","hashOfConfig":"6"},{"size":362,"mtime":499162500000,"results":"8","hashOfConfig":"6"},{"size":2682,"mtime":1649523574141,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"sbnwr8",{"filePath":"13","messages":"14","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"15","messages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"17","messages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\ultimateakash\\react-google-maps\\src\\index.js",[],["19","20"],"D:\\ultimateakash\\react-google-maps\\src\\App.js",[],"D:\\ultimateakash\\react-google-maps\\src\\reportWebVitals.js",[],"D:\\ultimateakash\\react-google-maps\\src\\components\\map.component.jsx",["21"],{"ruleId":"22","replacedBy":"23"},{"ruleId":"24","replacedBy":"25"},{"ruleId":"26","severity":1,"message":"27","line":33,"column":21,"nodeType":"28","messageId":"29","endLine":33,"endColumn":31},"no-native-reassign",["30"],"no-negated-in-lhs",["31"],"no-unused-vars","'setMarkers' is assigned a value but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"]
1+
[{"D:\\ultimateakash\\react-google-maps\\src\\index.js":"1","D:\\ultimateakash\\react-google-maps\\src\\App.js":"2","D:\\ultimateakash\\react-google-maps\\src\\reportWebVitals.js":"3","D:\\ultimateakash\\react-google-maps\\src\\components\\map.component.jsx":"4"},{"size":500,"mtime":499162500000,"results":"5","hashOfConfig":"6"},{"size":251,"mtime":1649183518322,"results":"7","hashOfConfig":"6"},{"size":362,"mtime":499162500000,"results":"8","hashOfConfig":"6"},{"size":2771,"mtime":1654270590629,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"88kbie",{"filePath":"12","messages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\ultimateakash\\react-google-maps\\src\\index.js",[],"D:\\ultimateakash\\react-google-maps\\src\\App.js",[],"D:\\ultimateakash\\react-google-maps\\src\\reportWebVitals.js",[],"D:\\ultimateakash\\react-google-maps\\src\\components\\map.component.jsx",["18"],{"ruleId":"19","severity":1,"message":"20","line":33,"column":21,"nodeType":"21","messageId":"22","endLine":33,"endColumn":31},"no-unused-vars","'setMarkers' is assigned a value but never used.","Identifier","unusedVar"]

src/components/map.component.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ const MapComponent = () => {
4646
console.log(event.latLng.lat(), event.latLng.lng())
4747
}
4848

49-
const markerClicked = (marker, index) => {
50-
setActiveInfoWindow(index)
51-
console.log(marker, index)
49+
const markerClicked = (event, index) => {
50+
setActiveInfoWindow(index)
51+
console.log(event.latLng.lat())
52+
console.log(event.latLng.lng())
5253
}
5354

54-
const markerDragEnd = (marker, index) => {
55-
console.log(marker, index)
55+
const markerDragEnd = (event, index) => {
56+
console.log(event.latLng.lat())
57+
console.log(event.latLng.lng())
5658
}
5759

5860
return (
@@ -69,8 +71,8 @@ const MapComponent = () => {
6971
position={marker.position}
7072
label={marker.label}
7173
draggable={marker.draggable}
72-
onDragEnd={event => markerDragEnd(marker, index)}
73-
onClick={event => markerClicked(marker, index)}
74+
onDragEnd={event => markerDragEnd(event, index)}
75+
onClick={event => markerClicked(event, index)}
7476
>
7577
{
7678
(activeInfoWindow === index)

0 commit comments

Comments
 (0)