Exemplo n.º 1
0
RHO_GLOBAL void mapview_create(rho_param *p)
{
    mapview_close();

    ourIsOldGoogleEngineUsed = false;

    // detect engine
    char* engine = "Google";
    if (p && p->type == RHO_PARAM_HASH) {
	rho_param *eng_p = NULL;
        for (int i = 0, lim = p->v.hash->size; i < lim; ++i) {
            char *name = p->v.hash->name[i];
            rho_param *value = p->v.hash->value[i];
            if (strcasecmp(name, "provider") == 0)
                eng_p = value;
        }
	if (eng_p && eng_p->type == RHO_PARAM_STRING) {
	   engine = eng_p->v.string;
	}
    }
    if (strcasecmp(engine, "Google") == 0) {
        ourIsOldGoogleEngineUsed = true;
    }

    if (ourIsOldGoogleEngineUsed) {
        google_mapview_create(p);
    }
    else {
        s_mapdevice = new rhomap::AndroidMapDevice(p);
    }
}
Exemplo n.º 2
0
RHO_GLOBAL void mapview_create(rho_param *p)
{
    mapview_close();

    ourIsOldGoogleEngineUsed = false;

    // detect engine
    const char* engine = "Google";
    if (p && p->type == RHO_PARAM_HASH) {
	rho_param *eng_p = NULL;
        for (int i = 0, lim = p->v.hash->size; i < lim; ++i) {
            char *name = p->v.hash->name[i];
            rho_param *value = p->v.hash->value[i];
            if (strcasecmp(name, "provider") == 0)
                eng_p = value;
        }
	if (eng_p && eng_p->type == RHO_PARAM_STRING) {
           if ((eng_p->v.string != NULL) && (eng_p->v.string[0] != 0)) {
	      engine = eng_p->v.string;
           }
	}
    }
    if (strcasecmp(engine, "Google") == 0) {
        ourIsOldGoogleEngineUsed = true;
    }

    if (ourIsOldGoogleEngineUsed) {
        google_mapview_create(p);
    }
    else {
		if (rho_map_check_param(p)) {
			s_mapdevice = new rhomap::AndroidMapDevice(p);
		}
		else {
		        RAWLOG_ERROR("MapView.create: wrong input parameters ! (parameters not validated !)");
		}
    }
}