<div id="$name"></div>

<script>
	mapboxgl.accessToken = 'pk.eyJ1Ijoic2ltdWxhbmljcyIsImEiOiJjano3d3FmZGkweHd0M2hvdTA1ZmhtNGx2In0.S14nO9HN7e3hY9Z9KZ3mCg';

	var mapboxClient = mapboxSdk({ accessToken: mapboxgl.accessToken });

	mapboxClient.geocoding
		.forwardGeocode({
			query: 'Wellington, New Zealand',
			autocomplete: false,
			limit: 1
		})
		.send()
		.then(function (response) {
			if (
				response &&
				response.body &&
				response.body.features &&
				response.body.features.length
			) {
				var feature = response.body.features[0];

				var map_$name = new mapboxgl.Map({
					container: '$name',
					style: 'mapbox://styles/mapbox/streets-v11',
					center: feature.center,
					zoom: 10
				});
			new mapboxgl.Marker().setLngLat(feature.center).addTo(map_$name);
			}
		});
</script>