Changeset 4270 for trunk/gui


Ignore:
Timestamp:
Mar 25, 2014 7:52:55 PM (10 years ago)
Author:
ldelgass
Message:

Add map type: geocentric or projected (default)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/map.tcl

    r4265 r4270  
    2525itcl::class Rappture::Map {
    2626    private variable _tree "";             # Tree of information about the map.
     27    private variable _isGeocentric 0;
    2728    private variable _isValid 0;
    2829    private variable _nextLayer 0;
     
    4445    }
    4546
     47    public method isGeocentric {}
    4648    public method layers {}
    4749    public method extents {}
     
    143145    $_tree set root "projection"  [$map get "projection"]
    144146
     147    set mapType [$map get "type"]
     148    if {$mapType == "geocentric"} {
     149        set _isGeocentric 1
     150    } elseif {$mapType != "projected"} {
     151        error "Invalid map type: $mapType"
     152    }
     153
    145154    foreach {key path} {
    146155        toolId          tool.id
     
    186195}
    187196
    188 
     197# ----------------------------------------------------------------------
     198# Returns if the map is geocentric (1) or projected (0)
     199# ----------------------------------------------------------------------
     200itcl::body Rappture::Map::isGeocentric {} {
     201    return $_isGeocentric
     202}
Note: See TracChangeset for help on using the changeset viewer.