OpenStreetMap and Here Maps with Expo

Hello everybody,

I’ve got both Here Maps and OpenStreetMap working with Expo MapView using the following code:

var region = {
	latitude: 50.73438,
	longitude: 7.09549,
	latitudeDelta: 0.0922,
	longitudeDelta: 0.0421,
};

/*
For refernce, below URL is for OpenStreetMap:
var tileUrl = "http://c.tile.openstreetmap.org/{z}/{x}/{y}.png";
*/
var tileUrl = "https://2.base.maps.cit.api.here.com/maptile/2.1/"
		+ "maptile/newest/normal.day/{z}/{x}/{y}/256/png8"
		+ "?app_id=" + HERE_APPID + "&app_code=" + HERE_APPCODE;

return (
	<MapView style={{ flex: 1 }} initialRegion={region} provider={null} 
			mapType={Platform.OS == "android" ? "none" : "standard"}>
		<UrlTile urlTemplate={tileUrl} maximumZ={19} />
	</MapView>
);

From a component perspective do I understand it correctly that with this implementation there will be no call to either Apple Maps or Google Maps but only to the defined Tile Server Url?

This is actually quite nice :slight_smile:

Regards,

Jan

_P.S.: please vote for this: Canny

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.