I am making an android app which uses an OpenStreetMap. I have my own tile server which serves the street map.
When I tell the app to centre on a specifc area on the map by passing the coordinates as a GeoPoint, it centres somewhere around Africa when it should centre on Edinburgh.
Here is the code:
// osm map view MapView osmMap;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
osmMap = (MapView) findViewById(R.id.mapview);
osmMap.setMultiTouchControls(true);
// Create custom map source pointing to Tile Server
XYTileSource myMapSource = new XYTileSource("myMap", null, 0, 16, 256, ".png", Constants.LOCAL_SERVER_URL);
// Set the source and default map coordinates/zoom
osmMap.setTileSource(myMapSource);
osmMap.getController().animateTo(new GeoPoint(55.95223359877632*1e6, -3.188550710678032*1e6));
osmMap.getController().setZoom(Constants.DEFAULT_ZOOM);
}
Anyone know how I can get the coordinates to align with the map correctly?
Thanks