当前位置: 首页>>代码示例>>C++>>正文


C++ Coordinates::Set方法代码示例

本文整理汇总了C++中Coordinates::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ Coordinates::Set方法的具体用法?C++ Coordinates::Set怎么用?C++ Coordinates::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Coordinates的用法示例。


在下文中一共展示了Coordinates::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LocationListener

bool
LocationMonitorApp::OnAppInitializing(AppRegistry& appRegistry)
{
	// TODO:
	// Initialize App specific data, and add your initialization code here
	// The App's permanent data and context can be obtained from the appRegistry.
	//
	// If this method is successful, return true; otherwise, return false.
	// If this method returns false, the App will be terminated.

	LocationListener* pListener = null;
	pListener = new LocationListener();

	LocationCriteria criteria;
	criteria.SetAccuracy(LOC_ACCURACY_HUNDRED_METERS);

	LocationProvider* pLocProvider = new LocationProvider();
	pLocProvider->Construct(criteria, *pListener);

	//bool awake = true;
	//pLocProvider->KeepLocationUpdateAwake(awake);

	Coordinates coord;
	coord.Set(27.0, 125.0, 0.0); //result 	Set (double latitude, double longitude, double altitude)
	RegionId regionId;
	pLocProvider->AddMonitoringRegion(coord, 100, regionId);

	MockLocationListener* timer = new MockLocationListener();
	timer->StartApp();

	return true;
}
开发者ID:AhnJihun,项目名称:passion,代码行数:32,代码来源:LocationMonitorApp.cpp

示例2:

bool
MapForm::MoveMarker(bool bMoved)
{
	bool bRet = _movedMarker;
	
	_movedMarker = bMoved;

	if (bMoved)
	{
		//Create Marker
		if (_pMovedMarker1 == null)
		{
			_pMovedMarker1 =  _pOverlay->MakeMarker();
			if (_pMovedMarker1 == null)
			{
				AppLog("Overlay::MakeMarker() has failed.");
			}
			else
			{
				Coordinates coord;
				coord.Set(51.501, -0.142 ,0); //backi
				_pMovedMarker1->SetCoordinates(coord);

				_pMap->AddMapOverlay(*_pMovedMarker1);
			}
		}

		if (_pMovedMarker2 == null)
		{
			_pMovedMarker2 =  _pOverlay->MakeMarker();
			if (_pMovedMarker2 == null)
			{
				AppLog("Overlay::MakeMarker() has failed.");
			}
			else
			{
				Coordinates coord;
				coord.Set(51.5033, -0.1197,0); //eye
				
				_pMovedMarker2->SetCoordinates(coord);
				_pMap->AddMapOverlay(*_pMovedMarker2);
			}
		}

		if (_pMovedMarker3 == null)
		{
			_pMovedMarker3 =  _pOverlay->MakeMarker();
			if (_pMovedMarker3 == null)
			{
				AppLog("Overlay::MakeMarker() has failed.");
			}
			else
			{
				Coordinates coord;
				coord.Set(51.500721983903,-0.124197006225586,0); //bigben
				
				_pMovedMarker3->SetCoordinates(coord);
				_pMap->AddMapOverlay(*_pMovedMarker3);
			}
		}
	}
	else
	{
		if (_pMovedMarker1 != null)
		{
			_pMap->RemoveMapOverlay(*_pMovedMarker1);

			delete _pMovedMarker1;
			_pMovedMarker1 = null;
		}

		if (_pMovedMarker2 != null)
		{
			_pMap->RemoveMapOverlay(*_pMovedMarker2);

			delete _pMovedMarker2;
			_pMovedMarker2 = null;
		}

		if (_pMovedMarker3 != null)
		{
			_pMap->RemoveMapOverlay(*_pMovedMarker3);

			delete _pMovedMarker3;
			_pMovedMarker3 = null;
		}
	}
	
	return bRet;
}
开发者ID:the0s,项目名称:BukkaTrips,代码行数:90,代码来源:MapForm.cpp

示例3: GetClientAreaBounds

bool
MapForm::InitializeMapService(void)
{
	result r = E_SUCCESS;

	// If you want to develop your own application with the location services.
	// Some service providers may need license key for displaying a map. refer to the developer guide for details.
	// Client name "guest" is invalid license.
	const String extraInfo =  L"ClientName=samsung-jc;ClientPassword=4xndosys;HostUrl=http://ws.decarta.com/openls/openls";

	Coordinates center;
	Rectangle clientRect = GetClientAreaBounds();

	// create map service provider and initialize map
	_pMapSvcProvider = static_cast<IMapServiceProvider*>(ProviderManager::ConnectToServiceProviderN(L"", LOC_SVC_PROVIDER_TYPE_MAP, extraInfo));
	if (null == _pMapSvcProvider)
	{
		AppLog( "ProviderManager::ConnectToServiceProviderN() has failed.");
		goto CATCH;
	}

	_pMap = new Map();
	if (null == _pMap)
	{
		AppLog( "MapForm::allocate new memory for map.");
		goto CATCH;
	}

	_pMap->Construct(Rectangle(0,0, clientRect.width, clientRect.height), *_pMapSvcProvider,true);
	if (IsFailed(r))
	{
		AppLog( "MapForm::fail to contruct map.");
		goto CATCH;
	}

	//Set the Prefetch Margin
	_pMap->SetPrefetchMargin(200,100);

	center.Set(51.499339, -0.126858, 0);
	_pMap->SetCenter(center, false);
	_pMap->SetZoomLevel(17.0, false);

	//This is used to make an application listen infowindow event.
	_pMap->AddMapInfoWindowEventListener(*this);

	_pMap->AddTouchEventListener(*this);

	AddControl(*_pMap);

	//Create overlay factory class
	_pOverlay = new Overlay(_pMap);

	// create geocoding service provider
	_pGeocodingSvcProvider = static_cast<IGeocodingServiceProvider*>(ProviderManager::ConnectToServiceProviderN(L"", LOC_SVC_PROVIDER_TYPE_GEOCODING, extraInfo));

	return true;

CATCH:

	delete _pMap;
	_pMap = null;

	delete _pMapSvcProvider;
	_pMapSvcProvider = null;
	return false;
}
开发者ID:the0s,项目名称:BukkaTrips,代码行数:66,代码来源:MapForm.cpp


注:本文中的Coordinates::Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。