How to use the leaflet.point function in leaflet

To help you get started, we’ve selected a few leaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / leaflet-label / leaflet-label-tests.ts View on Github external
example = () => {
	const myIcon = L.icon({
		iconUrl: 'my-icon.png',
		iconSize: L.point(20, 20),
		iconAnchor: L.point(10, 10),
		labelAnchor: L.point(6, 0) // as I want the label to appear 2px past the icon (10 + 2 - 6)
	});
	L.marker(L.latLng(-37.7772, 175.2606), {
		icon: myIcon
	}).bindLabel('Look revealing label!').addTo(map);
};
github TerriaJS / terriajs / lib / Models / Leaflet.js View on Github external
*/
    this.map = map;

    this.scene = new LeafletScene(map);

    this._tweens = new TweenCollection();
    this._tweensAreRunning = false;
    this._selectionIndicatorTween = undefined;
    this._selectionIndicatorIsAppearing = undefined;

    this._pickedFeatures = undefined;
    this._selectionIndicator = L.marker([0, 0], {
        icon: L.divIcon({
            className: '',
            html: '<img alt="" height="50" width="50" src="' + selectionIndicatorUrl + '">',
            iconSize: L.point(50, 50)
        }),
        clickable: false,
        keyboard: false
    });
    this._selectionIndicator.addTo(this.map);
    this._selectionIndicatorDomElement = this._selectionIndicator._icon.children[0];

    this._dragboxcompleted = false;

    this.scene.featureClicked.addEventListener(featurePicked.bind(undefined, this));

    var that = this;

    // if we receive dragboxend (see LeafletDragBox) and we are currently
    // accepting a rectangle, then return the box as the picked feature
    map.on('dragboxend', function(e) {
github Esri / esri-leaflet / src / Layers / FeatureLayer / FeatureGrid.js View on Github external
_keyToCellCoords: function (key) {
    var kArr = key.split(':');
    var x = parseInt(kArr[0], 10);
    var y = parseInt(kArr[1], 10);

    return L.point(x, y);
  },
github yagajs / leaflet-ng2 / ts / icon.directive.spec.ts View on Github external
it("should be changed in Angular when changing in Angular", () => {
            const val: Point = point(randomNumber(10, 1, 0), randomNumber(10, 1, 0));
            icon.iconSize = val;
            expect(icon.iconSize).to.equal(val);
        });
        it("should fire an event in Angular when changing in Angular", (done: Mocha.Done) => {
github yagajs / leaflet-ng2 / ts / scale-control.directive.spec.ts View on Github external
beforeEach(() => {
        map = new MapComponent(
            {nativeElement: document.createElement("div")},
            new LayerGroupProvider(),
            new MapProvider(),
        );
        (map as any)._size = point(100, 100);
        (map as any)._pixelOrigin = point(50, 50);
        control = new ScaleControlDirective({ ref: map });
    });
github SuperMap / iClient-JavaScript / src / leaflet / overlay / vectortile / SVGRenderer.js View on Github external
L.DomEvent.on(img, 'load', function () {
                var size = L.point([img.width, img.height]),
                    anchor = size && size.divideBy(2, true),
                    p = layer._point.subtract(anchor);
                path.setAttribute('x', p.x);
                path.setAttribute('y', p.y);
                path.setAttribute('width', size.x + 'px');
                path.setAttribute('height', size.y + 'px');
            });
        }
github cityofasheville / simplicity2 / src / shared / visualization / Map.js View on Github external
const createClusterCustomIcon = function (cluster) {
  return L.divIcon({
    html: `<div><span aria-label="${cluster.getChildCount()} projects">${cluster.getChildCount()}</span></div>`,
    className: 'marker-cluster-custom marker-cluster marker-cluster-small',
    iconSize: L.point(40, 40, true),
  });
}
const markerClusterOptions = {
github yagajs / leaflet-ng2 / ts / wms-layer.directive.spec.ts View on Github external
beforeEach(() => {
        map = new MapComponent(
            {nativeElement: document.createElement("div")},
            new LayerGroupProvider(),
            new MapProvider(),
        );
        (map as any)._size = point(100, 100);
        (map as any)._pixelOrigin = point(50, 50);
        layer = new WmsLayerDirective({ ref: map }, {} as any);
    });
github YUzhva / react-leaflet-markercluster / demo-app / examples / markercluster-options / example-one.js View on Github external
const createClusterCustomIcon = function (cluster) {
  return L.divIcon({
    html: `<span>${cluster.getChildCount()}</span>`,
    className: 'marker-cluster-custom',
    iconSize: L.point(40, 40, true),
  });
};
github FH-Potsdam / shifted-maps / stores / PlaceCircle.ts View on Github external
import { bounds, point, Point } from 'leaflet';
import { computed, observable } from 'mobx';

import { CRS, MAX_ZOOM, PLACE_DOT_RADIUS_SCALE } from './config';
import Place from './Place';
import roundPoint from './utils/roundPoint';
import VisualisationStore from './VisualisationStore';

const roundPlaceCirclePoint = roundPoint(0.2);

class PlaceCircle {
  readonly vis: VisualisationStore;
  readonly place: Place;

  @observable.ref
  graphPoint: Point = point(0, 0);

  constructor(vis: VisualisationStore, place: Place) {
    this.vis = vis;
    this.place = place;
  }

  @computed
  get active() {
    return this.vis.activeElement === this;
  }

  @computed
  get highlight() {
    return this.active || this.connectionLines.some(connectionLine => connectionLine.highlight);
  }