DebasishDhal99 commited on
Commit
1529f57
·
1 Parent(s): 7f14e86

Add option to remove position markers

Browse files

- search for 'Lagos', a marker will popup.
- you click on 'Remove Button', the marker and the text will disappear

Files changed (1) hide show
  1. frontend/src/components/Map.js +21 -1
frontend/src/components/Map.js CHANGED
@@ -379,7 +379,27 @@ const Map = ( { onMapClick, searchQuery, contentType } ) => {
379
  flexShrink: 0
380
  }}>
381
  <div style={{ marginBottom: '20px' }}>
382
- <h2>{wikiContent?.title || 'Search for a location'}</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  </div>
384
  {wikiContent ? (
385
  <div>
 
379
  flexShrink: 0
380
  }}>
381
  <div style={{ marginBottom: '20px' }}>
382
+ <h2 style={{ margin: 2}}>{wikiContent?.title || 'Search for a location'}</h2>
383
+ {markerPosition && (
384
+ <button
385
+ onClick={() => {
386
+ setMarkerPosition(null);
387
+ setWikiContent(null);
388
+ setIframeSrc('');
389
+ }}
390
+ style={{
391
+ padding: '3px 8px',
392
+ background: '#e53935',
393
+ color: 'white',
394
+ border: 'none',
395
+ borderRadius: 4,
396
+ cursor: 'pointer',
397
+ fontWeight: 500,
398
+ }}
399
+ >
400
+ Remove Marker
401
+ </button>
402
+ )}
403
  </div>
404
  {wikiContent ? (
405
  <div>