react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

Custom Marker Animations

Open eamonpenland opened this issue 9 years ago • 7 comments

I'm working on a project and need to add custom marker animations to animate travel between two locations(uber/lyft type effect). Has anyone implemented something similar? I was planning on using styled-components to handle the animation. Thanks

eamonpenland avatar May 23 '17 15:05 eamonpenland

figured it out

eamonpenland avatar May 28 '17 16:05 eamonpenland

@eamonpenland Any help how implement this?

epozsh avatar May 30 '17 09:05 epozsh

@eamonpenland joining @Shadowman4205 on a request for a quick example of how you figured this out. I am trying to pass css3 style animations to the Marker element, needless to say it isn't going so well 😆

srimenow avatar Jul 13 '17 11:07 srimenow

im using styled components something like this

const pulseAnimation = keyframes`
  0% {-webkit-transform: scale(0);opacity: 0.0;}
  25% {-webkit-transform: scale(0);opacity: 0.1;}
  50% {-webkit-transform: scale(0.1);opacity: 0.3;}
  75% {-webkit-transform: scale(0.5);opacity: 0.5;}
  100% {-webkit-transform: scale(1);opacity: 0.0;}
`;

const Pulse = styled.div`
  position: absolute;
  left: -16px;
  top: -15.91px;
  height: 50px;
  width: 50px;
  z-index: 2;
  opacity: 0;
  border: 10px solid rgba(0,166,205,1);;
  background: transparent;
  border-radius: 60px;
  animation: ${pulseAnimation} 2s ease-out infinite;
`;

const CustomDeviceIcon = styled.div`
  width: 18px;
  height: 18px;
  background-color: #00a9e8;
  color: #00a9e8;
  border: solid 3px #ffffff;
  border-radius: 50%;
  cursor: pointer;
`;


<OverlayView
  position={coordinates}
  mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
  getPixelPositionOffset={getPixelPositionOffset}
  key={id}
>
  <presentation onClick={() => handleShapeClick(id)}>
    <CustomDeviceIcon />
    <Pulse />
  </presentation>
</OverlayView>

eamonpenland avatar Jul 13 '17 15:07 eamonpenland

that isn't for the animation between points...just applying animations to the marker

eamonpenland avatar Jul 13 '17 15:07 eamonpenland

@eamonpenland : Hi, how did you manage to apply animation to the specific marker, I am trying to add a pulse effect on the marker but I am unable to position it to the respective markers.

Can you please help? I tried a lot of sites to get the answer, no luck yet! :(

satejrajam30 avatar Jan 09 '19 13:01 satejrajam30

@eamonpenland : No worries, I figured it out. Thanks

satejrajam30 avatar Jan 09 '19 13:01 satejrajam30