René's URL Explorer Experiment


Title: OnClick do not re-render the map · Issue #513 · fullstackreact/google-maps-react · GitHub

Open Graph Title: OnClick do not re-render the map · Issue #513 · fullstackreact/google-maps-react

X Title: OnClick do not re-render the map · Issue #513 · fullstackreact/google-maps-react

Description: Hi, I am trying to run google-map-react in my application. The idea is when I open the page with google maps it should show me a heatmap with all the data. Then I have a dropdown list where I can pick data based on the weekday. So for ex...

Open Graph Description: Hi, I am trying to run google-map-react in my application. The idea is when I open the page with google maps it should show me a heatmap with all the data. Then I have a dropdown list where I can p...

X Description: Hi, I am trying to run google-map-react in my application. The idea is when I open the page with google maps it should show me a heatmap with all the data. Then I have a dropdown list where I can p...

Opengraph URL: https://github.com/fullstackreact/google-maps-react/issues/513

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OnClick do not re-render the map","articleBody":"Hi,\r\n\r\nI am trying to run google-map-react in my application.\r\nThe idea is when I open the page with google maps it should show me a heatmap with all the data. Then I have a dropdown list where I can pick data based on the weekday. So for example if I pick monday the google map should rerender the map and show me only data for mondays. The map is rendered correctly at the beginning but when I click the button in the dropdown list it doesnt rerender.\r\n\r\nIs this a bug or am I doing something wrong? Hope that anyone can guide me here.\r\n\r\nI have shared my code below. The first code shows the state I am passing to Maps component. The second code is the Maps component.\r\n\r\nFIRST CODE\r\n\r\n```\r\nimport React, { useState, useEffect } from 'react'\r\nimport Map from '../map/Map'\r\nimport data from '../../assets/data/heatmapData'\r\nimport Scatter from \"../scatter-plot/Scatter\";\r\nimport Dropdown from 'react-bootstrap/Dropdown';\r\nimport DropdownButton from 'react-bootstrap/DropdownButton';\r\n\r\nimport './content-section.css'\r\n\r\nconst ContentSection = () => {\r\n  const [heatmapData, setHeatmapData] = useState(data);\r\n  // useEffect(() => {\r\n  //   handleWeekday()\r\n  // }, [])\r\n\r\n  const handleWeekday = (input) => \r\n  {\r\n    console.log(input);\r\n    const heatmapMondayData = [{ lat: 37.782551, lng: -122.44536800000003 },\r\n    { lat: 37.782745, lng: -122.44458600000002 },\r\n    { lat: 37.782842, lng: -122.44368800000001 },\r\n    { lat: 37.782919, lng: -122.442815 }];\r\n\r\n    setHeatmapData(heatmapMondayData ); \r\n  }\r\n\r\n  return (\r\n  \u003c>\r\n    \u003cdiv className=\"container\">\r\n      \u003cdiv className=\"header-text\">This is a header\u003c/div>\r\n      \u003cScatter />\r\n      \u003cMap center={{ lat: 37.775, lng: -122.434 }} zoom={13} positions={heatmapData} />\r\n      \u003cDropdownButton id=\"dropdown-basic-button\" title=\"Dropdown button\">\r\n        \u003cDropdown.Item onClick={handleMonday}>Monday\u003c/Dropdown.Item>\r\n \r\n      \u003c/DropdownButton>\r\n    \u003c/div>\r\n  \u003c/>\r\n  )\r\n}\r\n\r\nexport default ContentSection\r\n```\r\n\r\nSECOND CODE\r\n```\r\n\r\nimport React, { Component } from \"react\";\r\nimport { Map, HeatMap, GoogleApiWrapper } from \"google-maps-react\";\r\nimport './map.css'\r\n\r\nconst gradient = [\r\n    \"rgba(0, 255, 255, 0)\",\r\n    \"rgba(0, 255, 255, 1)\",\r\n    \"rgba(0, 191, 255, 1)\",\r\n    \"rgba(0, 127, 255, 1)\",\r\n    \"rgba(0, 63, 255, 1)\",\r\n    \"rgba(0, 0, 255, 1)\",\r\n    \"rgba(0, 0, 223, 1)\",\r\n    \"rgba(0, 0, 191, 1)\",\r\n    \"rgba(0, 0, 159, 1)\",\r\n    \"rgba(0, 0, 127, 1)\",\r\n    \"rgba(63, 0, 91, 1)\",\r\n    \"rgba(127, 0, 63, 1)\",\r\n    \"rgba(191, 0, 31, 1)\",\r\n    \"rgba(255, 0, 0, 1)\"\r\n  ];\r\n  class MapContainer extends React.Component {\r\n    render() {\r\n      console.log(this.props)\r\n\r\n      useEffect(() => {\r\n        this.props.positions\r\n      }, [])\r\n      return (\r\n            \u003cdiv className=\"map-container\">\r\n                \u003cMap\r\n                google={this.props.google}\r\n                zoom={this.props.zoom}\r\n                initialCenter={this.props.center}\r\n                >\r\n                    \u003cHeatMap\r\n                    gradient={gradient}\r\n                    positions={this.props.positions}\r\n                    opacity={1}\r\n                    radius={20}\r\n                    />\r\n          \u003c/Map>\r\n\r\n          \u003cdiv>{this.props.positions[0].lat}\u003c/div>\r\n\r\n            \u003c/div>\r\n      );\r\n    }\r\n  }\r\n  \r\n  export default GoogleApiWrapper({\r\n    apiKey: \"XXX\",\r\n    libraries: [\"visualization\"]\r\n  })(MapContainer);\r\n```\r\n  \r\n","author":{"url":"https://github.com/alikucukavci","@type":"Person","name":"alikucukavci"},"datePublished":"2021-05-06T13:40:39Z","url":"https://github.com/fullstackreact/google-maps-react/issues/513"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b45b7a3e-de7d-07b2-2069-25eac74baa86
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8982:1A1680:B8BA4F:F81AA4:6AFE6AAE
html-safe-nonceb08547fbef08b080be27693a5ee76a5429fb6063b53e61f12e40e307ac04760c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTgyOjFBMTY4MDpCOEJBNEY6RjgxQUE0OjZBRkU2QUFFIiwidmlzaXRvcl9pZCI6Ijc3MjcyOTkxODcwMTE2NDQwNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbebb58c9ccdf56b9765fca40c99e9d21e80648163260e0daee0107bf71a93498
hovercard-subject-tagissue:877510842
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fullstackreact/google-maps-react/513/issue_layout
twitter:imagehttps://opengraph.githubassets.com/90bdc2f564016c17b17168690187c9c8d967e24633f4dd6c8ba33f1d1ac6faa1/fullstackreact/google-maps-react/issues/513
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/90bdc2f564016c17b17168690187c9c8d967e24633f4dd6c8ba33f1d1ac6faa1/fullstackreact/google-maps-react/issues/513
og:image:altHi, I am trying to run google-map-react in my application. The idea is when I open the page with google maps it should show me a heatmap with all the data. Then I have a dropdown list where I can p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealikucukavci
hostnamegithub.com
expected-hostnamegithub.com
Noneb3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86
turbo-cache-controlno-preview
go-importgithub.com/fullstackreact/google-maps-react git https://github.com/fullstackreact/google-maps-react.git
octolytics-dimension-user_id16674738
octolytics-dimension-user_loginfullstackreact
octolytics-dimension-repository_id57070925
octolytics-dimension-repository_nwofullstackreact/google-maps-react
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id57070925
octolytics-dimension-repository_network_root_nwofullstackreact/google-maps-react
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a10310af51a1bfffbedc4fd81cb582acf0cb0ff
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/fullstackreact/google-maps-react/issues/513#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffullstackreact%2Fgoogle-maps-react%2Fissues%2F513
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffullstackreact%2Fgoogle-maps-react%2Fissues%2F513
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=fullstackreact%2Fgoogle-maps-react
Reloadhttps://github.com/fullstackreact/google-maps-react/issues/513
Reloadhttps://github.com/fullstackreact/google-maps-react/issues/513
Reloadhttps://github.com/fullstackreact/google-maps-react/issues/513
fullstackreacthttps://github.com/fullstackreact
google-maps-reacthttps://github.com/fullstackreact/google-maps-react
Codehttps://github.com/fullstackreact/google-maps-react
Issues263 (263)https://github.com/fullstackreact/google-maps-react/issues
Pull requests29 (29)https://github.com/fullstackreact/google-maps-react/pulls
Actionshttps://github.com/fullstackreact/google-maps-react/actions
Projectshttps://github.com/fullstackreact/google-maps-react/projects
Security and qualityhttps://github.com/fullstackreact/google-maps-react/security
Insightshttps://github.com/fullstackreact/google-maps-react/insights
https://github.com/fullstackreact/google-maps-react
New issuehttps://github.com/login?return_to=https://github.com/fullstackreact/google-maps-react/issues/513
New issuehttps://github.com/login?return_to=https://github.com/fullstackreact/google-maps-react/issues/513
OnClick do not re-render the maphttps://github.com/fullstackreact/google-maps-react/issues/513#top
https://github.com/alikucukavci
alikucukavcihttps://github.com/alikucukavci
on May 6, 2021https://github.com/fullstackreact/google-maps-react/issues/513#issue-877510842
Sign up for freehttps://github.com/signup?return_to=https://github.com/fullstackreact/google-maps-react/issues/513
Sign in to commenthttps://github.com/login?return_to=https://github.com/fullstackreact/google-maps-react/issues/513
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.