/** * Set max bounds option. * * @param LatLngBounds|array $bounds Max bounds. * * @return $this * @see http://leafletjs.com/reference.html#map-maxbounds * * @throws InvalidArgumentException If invalid bounds given. */ public function setMaxBounds($bounds) { if (is_array($bounds)) { $bounds = LatLngBounds::fromArray($bounds); } Assertion::isInstanceOf($bounds, 'Netzmacht/LeafletPHP/Type/LatLngBounds'); return $this->setOption('maxBounds', $bounds); }
/** * Add a latitude longitude position. * * This method differs from the Leaflet JS API! Instead of passing the shape as second argument you can define * the index of the ring. * * @param LatLng|array|string $latLng LatLng coordinate. * @param int $ringIndex The index of the ring. * * @return $this */ public function addLatLng($latLng, $ringIndex = 0) { if (is_scalar($latLng)) { $latLng = LatLng::fromNative($latLng); } Assertion::isInstanceOf($latLng, 'Netzmacht\\LeafletPHP\\Value\\LatLng'); $ringIndex = (int) $ringIndex; $this->latLngs[$ringIndex][] = $latLng; return $this; }