public void setInitialTagValueZoom(String tag, String val, int zoom, BinaryMapDataObject obj) {
   clearState();
   object = obj;
   setIntFilter(ALL.R_MINZOOM, zoom);
   setIntFilter(ALL.R_MAXZOOM, zoom);
   setStringFilter(ALL.R_TAG, tag);
   setStringFilter(ALL.R_VALUE, val);
 }
Example #2
0
  private TIntObjectHashMap<TIntArrayList> sortObjectsByProperOrder(
      RenderingContext rc, List<BinaryMapDataObject> objects, RenderingRuleSearchRequest render) {
    int sz = objects.size();
    TIntObjectHashMap<TIntArrayList> orderMap = new TIntObjectHashMap<TIntArrayList>();
    if (render != null) {
      render.clearState();

      for (int i = 0; i < sz; i++) {
        BinaryMapDataObject o = objects.get(i);
        int sh = i << 8;

        for (int j = 0; j < o.getTypes().length; j++) {
          // put(orderMap, BinaryMapDataObject.getOrder(o.getTypes()[j]), sh + j, init);
          int wholeType = o.getTypes()[j];

          int layer = 0;
          if (o.getPointsLength() > 1) {
            layer = o.getSimpleLayer();
          }

          TagValuePair pair = o.getMapIndex().decodeType(wholeType);
          if (pair != null) {
            render.setTagValueZoomLayer(pair.tag, pair.value, rc.zoom, layer, o);
            render.setBooleanFilter(render.ALL.R_AREA, o.isArea());
            render.setBooleanFilter(render.ALL.R_POINT, o.getPointsLength() == 1);
            render.setBooleanFilter(render.ALL.R_CYCLE, o.isCycle());
            if (render.search(RenderingRulesStorage.ORDER_RULES)) {
              int objectType = render.getIntPropertyValue(render.ALL.R_OBJECT_TYPE);
              int order = render.getIntPropertyValue(render.ALL.R_ORDER);
              put(orderMap, (order << 2) | objectType, sh + j);
              if (objectType == 3) {
                // add icon point all the time
                put(orderMap, (128 << 2) | 1, sh + j);
              }
              if (render.isSpecified(render.ALL.R_SHADOW_LEVEL)) {
                rc.shadowLevelMin = Math.min(rc.shadowLevelMin, order);
                rc.shadowLevelMax = Math.max(rc.shadowLevelMax, order);
                render.clearValue(render.ALL.R_SHADOW_LEVEL);
              }
            }
          }
        }

        if (rc.interrupted) {
          return orderMap;
        }
      }
    }
    return orderMap;
  }