Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 13
Registered: ‎01-22-2013
My Device: Blackbery 10 Dev Alpha Simulator
My Carrier: Life

ReverseGeocode doesn't work for China and some other countries

[ Edited ]

Recently found out that QGeoSearchManager  - > reverseGeocode  doesn't work for some countries:

As example China , India ans so on (sample coordinates: "28.4555, 88.6356 " ; "29.338 ,107.463 ").

Where can I get the list of supported countries ? Thx!

 

void GeoViewController::getNewsForLocation(double lat, double lon) {
	QGeoSearchManager *searchManager = geoProviderService->searchManager();
	searchManager->setProperty( "boundary", "country" );
	QGeoCoordinate GCoor(lat,lon);
	reply = searchManager->reverseGeocode(GCoor);
	if (reply->isFinished()) {
		if (reply->error() == QGeoSearchReply::NoError)
			readReverseGeocode();
		else
			reverseGeocodeError(reply->error(), reply->errorString());
		return;
	}
	bool finished_connected = QObject::connect(reply, SIGNAL(finished()),
			this, SLOT(readReverseGeocode()));
	bool error_connected = QObject::connect(reply,
			SIGNAL(error(QGeoSearchReply::Error, QString)), this,
			SLOT(reverseGeocodeError(QGeoSearchReply::Error, QString)));
}
//Reverse GeoLocation
void GeoViewController::readReverseGeocode() {
	if(reply->places().size()){
		QGeoPlace locDe = reply->places().at(0);
		qDebug() << "State --> " << locDe.address().state();
		qDebug() << "Country Code --> " << locDe.address().countryCode();
		qDebug() << "Country --> " << locDe.address().country();
//some work here with country
	}else{
		mToast->setBody(qtTrId("DETERMINE_ERROR"));
		mToast->setPosition(SystemUiPosition::MiddleCenter);
		mToast->resetButton();
		mToast->show();
	}

	reply->deleteLater();
	setPageState(getView(),Default);

}

 

New Developer
Posts: 13
Registered: ‎01-22-2013
My Device: Blackbery 10 Dev Alpha Simulator
My Carrier: Life

Re: ReverseGeocode doesn't work for China and some other countries

any ideas ?