/** * Initialize the lat/lon scalar maps * * @throws RemoteException On badness * @throws VisADException On badness */ public void initLatLonMap() throws VisADException, RemoteException { if (latMap != null) { return; } if (getDisplayMaster() == null) { return; } boolean callScale = (latMap == null); DisplayImpl display = (DisplayImpl) getDisplayMaster().getDisplay(); // find spatial maps for Latitude and Longitude latMap = null; lonMap = null; Vector scalar_map_vector = display.getMapVector(); Enumeration en = scalar_map_vector.elements(); while (en.hasMoreElements()) { ScalarMap map = (ScalarMap) en.nextElement(); DisplayRealType real = map.getDisplayScalar(); DisplayTupleType tuple = real.getTuple(); if ((tuple != null) && (tuple.equals(Display.DisplaySpatialCartesianTuple) || ((tuple.getCoordinateSystem() != null) && tuple .getCoordinateSystem() .getReference() .equals(Display.DisplaySpatialCartesianTuple)))) { // Spatial if (RealType.Latitude.equals(map.getScalar())) { latMap = map; } else if (RealType.Longitude.equals(map.getScalar())) { lonMap = map; } } } if (callScale) { setScale(baseScale); } }