OpenStreetMap and Here Maps with Expo

#1

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: https://expo.canny.io/feature-requests/p/in-app-purchases

closed #2

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