Exemple #1
0
RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_mapview_MapView_setSize
  (JNIEnv *env, jobject, jobject jDevice, jlong nativeDevice, jint width, jint height)
{
    RHO_MAP_TRACE("Java_com_rhomobile_rhodes_mapview_MapView_setSize: start");
    rhomap::AndroidMapDevice *d = device(env, nativeDevice);
    rhomap::IMapView *mv = d->mapView();
    if (!mv) {
        mv = rho_map_create(d->params(), d, width, height);
        d->setMapView(mv);
        d->attach(env, jDevice);
    }
    if (mv)
        mv->setSize(width, height);
    RHO_MAP_TRACE("Java_com_rhomobile_rhodes_mapview_MapView_setSize: finish");
}
Exemple #2
0
LRESULT CRhoMapViewDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	SetWindowText(_T("MapView"));

#if defined(_WIN32_WCE) 

#if !defined (OS_PLATFORM_MOTCE)
	SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN };
	RHO_ASSERT(SHInitDialog(&shidi));


	SHMENUBARINFO mbi = { sizeof(mbi), 0 };
	mbi.hwndParent = m_hWnd;
	mbi.nToolBarId = IDR_GETURL_MENUBAR;//IDR_MAPVIEW;
	mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
	
	SHCreateMenuBar(&mbi);
#else
	m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1);
	CommandBar_AddAdornments(m_hWndCommandBar, 0, 0 );
    CommandBar_Show(m_hWndCommandBar, TRUE);
#endif //OS_WINCE

	//::SetWindowLong(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, 
	//	GWL_EXSTYLE,
	//	::GetWindowLong(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, GWL_EXSTYLE) | WS_EX_TRANSPARENT);


	RECT r;
	::GetClientRect(m_hWnd, &r);

	RHO_MAP_TRACE2("execute rho_map_create( w = %d,  h = %d )", r.right - r.left, r.bottom - r.top);
	ourMapView = rho_map_create(mParams, &ourDrawingDevice, r.right - r.left, r.bottom - r.top);
	rho_param_free(mParams);
	mParams = NULL;


	if (ourMapView != NULL) {
		int minz = ourMapView->minZoom();
		int maxz = ourMapView->maxZoom();
		RHO_MAP_TRACE2("request Zoom limits: minZoom = %d,  maxZoom = %d", minz, maxz);
		::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETRANGEMIN, FALSE, minz); 
		::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETRANGEMAX, FALSE, maxz); 
		int dwPos = ourMapView->zoom();
		dwPos = ourMapView->maxZoom() - (dwPos - ourMapView->minZoom());
		::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETPOS, TRUE, dwPos); 

		String strImagePath = "lib/res/blue_pushpin.png";
		String fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
		IDrawingImage* pinImg = ourDrawingDevice.createImage(fullImagePath, true);

        PIN_INFO pin_info = {0};
		pin_info.x_offset = -10;
		pin_info.y_offset = -35;
		pin_info.click_rect_x = -10;
		pin_info.click_rect_y = -35;
		pin_info.click_rect_width = 72;
		pin_info.click_rect_height = 72;

		ourMapView->setPinImage(pinImg, pin_info);

		strImagePath = "lib/res/callout.png";
		fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
		IDrawingImage* pinCalloutImg = ourDrawingDevice.createImage(fullImagePath, true);

        PIN_INFO pin_callout_info = {0};
		pin_callout_info.x_offset = 5;
		pin_callout_info.y_offset = 0;
		pin_callout_info.click_rect_width = 179;
		pin_callout_info.click_rect_height = 64;

		ourMapView->setPinCalloutImage(pinCalloutImg, pin_callout_info);

		strImagePath = "lib/res/callout_link.png";
		fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
		IDrawingImage* pinCalloutLinkImg = ourDrawingDevice.createImage(fullImagePath, true);
		ourMapView->setPinCalloutLinkImage(pinCalloutLinkImg, pin_callout_info);

		strImagePath = "lib/res/esri.png";
		fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
		IDrawingImage* esriLogoImg = ourDrawingDevice.createImage(fullImagePath, true);
		ourMapView->setESRILogoImage(esriLogoImg);
	}

#else 

	//CreateButtons();
	//GotoDlgCtrl(m_btnOk);

#endif

	requestRedraw();

	return FALSE;
}