Skip to main content

Location

Location class. Contains lat/lon, x/y coordinates, image, address and marker. Whenever you need to add a marker to the map, start with creating a location first.

const location = new mapsvg.location({
geoPoint: {
lat: 55.22,
lng: 64.12,
},
img: "/path/to/image.png"
});

const marker = new mapsvg.marker({
location: location,
mapsvg: map
});

map.addMarker(marker);

Index

Constructors

constructor

Properties

optionaladdress

address?: LocationAddress

optionalgeoPoint

geoPoint?: GeoPoint

imagePath

imagePath: string

img

img: string

optionalmarker

marker?: Marker

optionalobject

object?: Model

optionalsvgPoint

svgPoint?: SVGPoint

Methods

getData

  • getData(): { address: LocationAddress; geoPoint?: { lat: number; lng: number }; imagePath: string; img: string; markerImagePath: string; svgPoint?: { x: number; y: number } }
  • Returns only essential data of the location


    Returns { address: LocationAddress; geoPoint?: { lat: number; lng: number }; imagePath: string; img: string; markerImagePath: string; svgPoint?: { x: number; y: number } }

    • address: LocationAddress
    • optionalgeoPoint?: { lat: number; lng: number }
      • lat: number
      • lng: number
    • imagePath: string
    • img: string
    • markerImagePath: string
    • optionalsvgPoint?: { x: number; y: number }
      • x: number
      • y: number

getImageUrl

  • getImageUrl(): string
  • Returns full image path


    Returns string

    string URL path

getMarkerImage

  • getMarkerImage(): string
  • Returns full marker image URL


    Returns string

    image URL

setAddress

  • setAddress(address: {}): void
  • Parameters

    • address: {}

    Returns void

setGeoPoint

  • setGeoPoint(geoPoint: GeoPoint | { lat: number; lng: number }): void
  • Sets GeoPoint of the location (lat/lng coordinates)


    Parameters

    • geoPoint: GeoPoint | { lat: number; lng: number }

    Returns void

    void

setObject

  • setObject(object: Model): void
  • Sets parent object


    Parameters

    Returns void

setSvgPoint

  • setSvgPoint(svgPoint: SVGPoint | { x: number; y: number }): void
  • Sets SvgPoint of the location (x/y coordinates)


    Parameters

    • svgPoint: SVGPoint | { x: number; y: number }

    Returns void

    void

update