private function _renderMap ($value, $isSettings = false)
	{
		$view = Craft::$app->getView();

		$containerId = $this->id . '-container';
		$vueContainerId = $view->namespaceInputId($containerId);
		$view->registerJsFile('https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry');
		$view->registerAssetBundle(MapAsset::class);
		$view->registerJs('new Vue({ el: \'#' . $vueContainerId . '\' });');
		$view->registerTranslations('simplemap', [
			'Search for a location',
			'Clear',
			'Name / Number',
			'Street Address',
			'Town / City',
			'Postcode',
			'County',
			'State',
			'Country',
			'Latitude',
			'Longitude',
		]);

		/** @var Settings $settings */
		$settings = SimpleMap::getInstance()->getSettings();

		$country = $this->country;
		// Convert ISO2 to ISO3 for Here autocomplete
		if ($country && $settings->geoService === GeoEnum::Here)
			$country = GeoService::$countriesIso3[$country];

		$opts = [
			'config' => [
				'isSettings' => $isSettings,

				'name'        => $view->namespaceInputName($this->handle),
				'country'     => $country,
				'hideSearch'  => (bool) $this->hideSearch,
				'hideMap'     => (bool) $this->hideMap,
				'hideAddress' => (bool) $this->hideAddress,
				'showLatLng'  => (bool) $this->showLatLng,

				'mapTiles' => $settings->mapTiles,
				'mapToken' => GeoService::getToken(
					$settings->mapToken,
					$settings->mapTiles
				),

				'geoService' => $settings->geoService,
				'geoToken'   => GeoService::getToken(
					$settings->geoToken,
					$settings->geoService
				),

				'locale' => Craft::$app->locale->getLanguageID(),
			],

			'value' => [
				'address' => $value->address,
				'lat'     => $value->lat,
				'lng'     => $value->lng,
				'zoom'    => $value->zoom,
				'parts'   => $value->parts,
			],

			'defaultValue' => [
				'address' => null,
				'lat'     => $this->lat,
				'lng'     => $this->lng,
				'zoom'    => $this->zoom,
				'parts'   => null,
			],
		];

		// Map Services
		// ---------------------------------------------------------------------

		if (strpos($settings->mapTiles, 'google') !== false)
		{
			$view->registerJsFile(
				'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
				$settings->mapToken
			);
		}
		elseif (strpos($settings->mapTiles, 'mapkit') !== false)
		{
			$view->registerJsFile(
				'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
			);
		}

		// Geo Services
		// ---------------------------------------------------------------------

		if ($settings->geoService === GeoEnum::GoogleMaps)
		{
			$view->registerJsFile(
				'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
				$settings->geoToken
			);
		}
		elseif ($settings->geoService === GeoEnum::AppleMapKit)
		{
			$view->registerJsFile(
				'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
			);
		}

		$options = preg_replace(
			'/\'/',
			'&#039;',
			json_encode($opts)
		);

		return '<div id="' . $containerId . '"><simple-map options=\'' . $options . '\'></simple-map></div>';
	}
private function _renderMap ($value, $isSettings = false)
	{
		$view = Craft::$app->getView();

		$containerId = $this->id . '-container';
		$vueContainerId = $view->namespaceInputId($containerId);
		$view->registerJsFile('https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry');
		$view->registerAssetBundle(MapAsset::class);
		$view->registerJs('new Vue({ el: \'#' . $vueContainerId . '\' });');
		$view->registerTranslations('simplemap', [
			'Search for a location',
			'Clear',
			'Name / Number',
			'Street Address',
			'Town / City',
			'Postcode',
			'County',
			'State',
			'Country',
			'Latitude',
			'Longitude',
		]);

		/** @var Settings $settings */
		$settings = SimpleMap::getInstance()->getSettings();

		$country = $this->country;
		// Convert ISO2 to ISO3 for Here autocomplete
		if ($country && $settings->geoService === GeoEnum::Here)
			$country = GeoService::$countriesIso3[$country];

		$opts = [
			'config' => [
				'isSettings' => $isSettings,

				'name'        => $view->namespaceInputName($this->handle),
				'country'     => $country,
				'hideSearch'  => (bool) $this->hideSearch,
				'hideMap'     => (bool) $this->hideMap,
				'hideAddress' => (bool) $this->hideAddress,
				'showLatLng'  => (bool) $this->showLatLng,

				'mapTiles' => $settings->mapTiles,
				'mapToken' => GeoService::getToken(
					$settings->mapToken,
					$settings->mapTiles
				),

				'geoService' => $settings->geoService,
				'geoToken'   => GeoService::getToken(
					$settings->geoToken,
					$settings->geoService
				),

				'locale' => Craft::$app->locale->getLanguageID(),
			],

			'value' => [
				'address' => $value->address,
				'lat'     => $value->lat,
				'lng'     => $value->lng,
				'zoom'    => $value->zoom,
				'parts'   => $value->parts,
			],

			'defaultValue' => [
				'address' => null,
				'lat'     => $this->lat,
				'lng'     => $this->lng,
				'zoom'    => $this->zoom,
				'parts'   => null,
			],
		];

		// Map Services
		// ---------------------------------------------------------------------

		if (strpos($settings->mapTiles, 'google') !== false)
		{
			$view->registerJsFile(
				'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
				$settings->mapToken
			);
		}
		elseif (strpos($settings->mapTiles, 'mapkit') !== false)
		{
			$view->registerJsFile(
				'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
			);
		}

		// Geo Services
		// ---------------------------------------------------------------------

		if ($settings->geoService === GeoEnum::GoogleMaps)
		{
			$view->registerJsFile(
				'https://maps.googleapis.com/maps/api/js?libraries=places&key=' .
				$settings->geoToken
			);
		}
		elseif ($settings->geoService === GeoEnum::AppleMapKit)
		{
			$view->registerJsFile(
				'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js'
			);
		}

		$options = preg_replace(
			'/\'/',
			'&#039;',
			json_encode($opts)
		);

		return '<div id="' . $containerId . '"><simple-map options=\'' . $options . '\'></simple-map></div>';
	}
private function _renderMap ( $ value , $ isSettings = false ) { $ view = Craft :: $ app -> getView ( ) ; $ containerId = $ this -> id . '-container' ; $ vueContainerId = $ view -> namespaceInputId ( $ containerId ) ; $ view -> registerJsFile ( 'https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry' ) ; $ view -> registerAssetBundle ( MapAsset :: class ) ; $ view -> registerJs ( 'new Vue({ el: \'#' . $ vueContainerId . '\' });' ) ; $ view -> registerTranslations ( 'simplemap' , [ 'Search for a location' , 'Clear' , 'Name / Number' , 'Street Address' , 'Town / City' , 'Postcode' , 'County' , 'State' , 'Country' , 'Latitude' , 'Longitude' , ] ) ; /** @var Settings $settings */ $ settings = SimpleMap :: getInstance ( ) -> getSettings ( ) ; $ country = $ this -> country ; // Convert ISO2 to ISO3 for Here autocomplete if ( $ country && $ settings -> geoService === GeoEnum :: Here ) $ country = GeoService :: $ countriesIso3 [ $ country ] ; $ opts = [ 'config' => [ 'isSettings' => $ isSettings , 'name' => $ view -> namespaceInputName ( $ this -> handle ) , 'country' => $ country , 'hideSearch' => ( bool ) $ this -> hideSearch , 'hideMap' => ( bool ) $ this -> hideMap , 'hideAddress' => ( bool ) $ this -> hideAddress , 'showLatLng' => ( bool ) $ this -> showLatLng , 'mapTiles' => $ settings -> mapTiles , 'mapToken' => GeoService :: getToken ( $ settings -> mapToken , $ settings -> mapTiles ) , 'geoService' => $ settings -> geoService , 'geoToken' => GeoService :: getToken ( $ settings -> geoToken , $ settings -> geoService ) , 'locale' => Craft :: $ app -> locale -> getLanguageID ( ) , ] , 'value' => [ 'address' => $ value -> address , 'lat' => $ value -> lat , 'lng' => $ value -> lng , 'zoom' => $ value -> zoom , 'parts' => $ value -> parts , ] , 'defaultValue' => [ 'address' => null , 'lat' => $ this -> lat , 'lng' => $ this -> lng , 'zoom' => $ this -> zoom , 'parts' => null , ] , ] ; // Map Services // --------------------------------------------------------------------- if ( strpos ( $ settings -> mapTiles , 'google' ) !== false ) { $ view -> registerJsFile ( 'https://maps.googleapis.com/maps/api/js?libraries=places&key=' . $ settings -> mapToken ) ; } elseif ( strpos ( $ settings -> mapTiles , 'mapkit' ) !== false ) { $ view -> registerJsFile ( 'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js' ) ; } // Geo Services // --------------------------------------------------------------------- if ( $ settings -> geoService === GeoEnum :: GoogleMaps ) { $ view -> registerJsFile ( 'https://maps.googleapis.com/maps/api/js?libraries=places&key=' . $ settings -> geoToken ) ; } elseif ( $ settings -> geoService === GeoEnum :: AppleMapKit ) { $ view -> registerJsFile ( 'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js' ) ; } $ options = preg_replace ( '/\'/' , '&#039;' , json_encode ( $ opts ) ) ; return '<div id="' . $ containerId . '"><simple-map options=\'' . $ options . '\'></simple-map></div>' ; }
Renders the map input

@param      $value
@param bool $isSettings

@return string
@throws InvalidConfigException
Renders the map input