leaflet#Icon TypeScript Examples

The following examples show how to use leaflet#Icon. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BullseyeMarker.tsx    From project-tauntaun with GNU Lesser General Public License v3.0 6 votes vote down vote up
export function BullseyeMarkerNonMemo(props: MarkerProps) {
  const icon = new Icon({
    iconUrl: 'bullseye.png',
    iconSize: [40, 40],
    iconAnchor: [20, 20]
  });

  return <Marker {...omit(props, 'onadd', 'icon')} icon={icon} />;
}
Example #2
Source File: SidcMarker.tsx    From project-tauntaun with GNU Lesser General Public License v3.0 6 votes vote down vote up
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function SidcMarkerNonMemo(props: SidcMarkerProps) {
  const { sidc, label } = props;

  const symbol = new ms.Symbol(sidc, { size: 20 });
  const anchor = symbol.getAnchor();
  const icon = new Icon({
    iconUrl: symbol.toDataURL(),
    iconAnchor: [anchor.x, anchor.y]
  });

  return (
    <Marker {...omit(props, 'onadd', 'icon')} icon={icon}>
      {label && <Popup minWidth={100}>{label}</Popup>}
    </Marker>
  );
}
Example #3
Source File: Maps.tsx    From roamjs-com with MIT License 6 votes vote down vote up
MarkerIcon = new Icon({
  iconUrl: "https://unpkg.com/[email protected]/dist/images/marker-icon.png",
  iconRetinaUrl:
    "https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",
  shadowUrl: "https://unpkg.com/[email protected]/dist/images/marker-shadow.png",
  iconSize: [25, 41],
  iconAnchor: [12, 41],
  popupAnchor: [1, -34],
  tooltipAnchor: [16, -28],
  shadowSize: [41, 41],
})
Example #4
Source File: GenericMarker.ts    From LiveAtlas with Apache License 2.0 5 votes vote down vote up
getIcon(): Icon.Default {
		return this.options.icon as Icon.Default;
	}