Changeset 4346 for trunk


Ignore:
Timestamp:
Apr 21, 2014 2:04:58 PM (7 years ago)
Author:
ldelgass
Message:

Add xyz image driver support: used by e.g. MapQuest? OSM

Location:
trunk/packages/vizservers/geovis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/geovis/RendererCmd.cpp

    r4332 r4346  
    3030#include <osgEarthDrivers/tms/TMSOptions>
    3131#include <osgEarthDrivers/wms/WMSOptions>
     32#include <osgEarthDrivers/xyz/XYZOptions>
    3233#include <osgEarthDrivers/model_feature_geom/FeatureGeomModelOptions>
    3334#include <osgEarthDrivers/feature_ogr/OGRFeatureOptions>
     
    801802
    802803            char *name = Tcl_GetString(objv[9]);
     804            g_renderer->addImageLayer(name, opts);
     805        } else if (driver[0] == 'x' && strcmp(driver, "xyz") == 0) {
     806            osgEarth::Drivers::XYZOptions opts;
     807            opts.url() = url;
     808            opts.profile() = osgEarth::ProfileOptions("global-mercator");
     809            //bool invertY = false;
     810            //opts.invertY() = invertY;
     811            //opts.format() = Tcl_GetString(objv[6]);
     812            char *name = Tcl_GetString(objv[6]);
    803813            g_renderer->addImageLayer(name, opts);
    804814        } else {
     
    905915        char *priority = Tcl_GetString(objv[6]);
    906916        char *name = Tcl_GetString(objv[7]);
     917
     918#if 0
     919        double fgR = 1.0, fgG = 1.0, fgB = 1.0;
     920        double bgR = 0.0, bgG = 0.0, bgB = 0.0;
     921        if (objc > 8) {
     922            if (Tcl_GetDoubleFromObj(interp, objv[8], &fgR) != TCL_OK ||
     923                Tcl_GetDoubleFromObj(interp, objv[9], &fgG) != TCL_OK ||
     924                Tcl_GetDoubleFromObj(interp, objv[10], &fgB) != TCL_OK ||
     925                Tcl_GetDoubleFromObj(interp, objv[11], &bgR) != TCL_OK ||
     926                Tcl_GetDoubleFromObj(interp, objv[12], &bgG) != TCL_OK ||
     927                Tcl_GetDoubleFromObj(interp, objv[13], &bgB) != TCL_OK) {
     928                return TCL_ERROR;
     929            }
     930        }
     931#endif
    907932        opts.url() = url;
    908933
    909934        osgEarth::Symbology::Style style;
    910935        osgEarth::Symbology::TextSymbol *ts = style.getOrCreateSymbol<osgEarth::Symbology::TextSymbol>();
    911         ts->halo()->color() = osgEarth::Symbology::Color::Black;
     936        ts->halo()->color() = osgEarth::Symbology::Color::Black; //::Color(bgR, bgG, bgB);
    912937        ts->halo()->width() = 2.0f;
    913         ts->fill()->color() = osgEarth::Symbology::Color::White;
     938        ts->fill()->color() = osgEarth::Symbology::Color::White; //::Color(fgR, fgG, fgB);
    914939        ts->content() = osgEarth::Symbology::StringExpression(content);
    915940        ts->priority() = osgEarth::Symbology::NumericExpression(priority);
  • trunk/packages/vizservers/geovis/geovis_protocol.txt

    r4333 r4346  
    9191map layer add <type> <driver> <url> ... <layerName>
    9292    <type> = image|elevation|line|point|polygon|text
    93     <driver> = gdal|wms|tms
     93    <driver> = gdal|wms|tms|xyz
    9494
    9595Specific layer types:
Note: See TracChangeset for help on using the changeset viewer.