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);
 }
 public void setTagValueZoomLayer(
     String tag, String val, int zoom, int layer, BinaryMapDataObject obj) {
   object = obj;
   setIntFilter(ALL.R_MINZOOM, zoom);
   setIntFilter(ALL.R_MAXZOOM, zoom);
   setIntFilter(ALL.R_LAYER, layer);
   setStringFilter(ALL.R_TAG, tag);
   setStringFilter(ALL.R_VALUE, val);
 }
Esempio n. 3
0
 private void createTextDrawInfo(
     BinaryMapDataObject o,
     RenderingRuleSearchRequest render,
     RenderingContext rc,
     TagValuePair pair,
     float xMid,
     float yMid,
     Path path,
     PointF[] points,
     String name,
     String tagName) {
   render.setInitialTagValueZoom(pair.tag, pair.value, rc.zoom, o);
   render.setIntFilter(render.ALL.R_TEXT_LENGTH, name.length());
   render.setStringFilter(render.ALL.R_NAME_TAG, tagName);
   if (render.search(RenderingRulesStorage.TEXT_RULES)) {
     if (render.getIntPropertyValue(render.ALL.R_TEXT_SIZE) > 0) {
       TextDrawInfo text = new TextDrawInfo(name);
       text.fillProperties(render, xMid, yMid);
       paintText.setTextSize(rc.getDensityValue(text.textSize));
       Rect bs = new Rect();
       paintText.getTextBounds(name, 0, name.length(), bs);
       text.bounds = new RectF(bs);
       text.bounds.inset(-rc.getDensityValue(3), -rc.getDensityValue(10));
       boolean display = true;
       if (path != null) {
         text.drawOnPath = path;
         display =
             calculatePathToRotate(
                 rc, text, points, render.getIntPropertyValue(render.ALL.R_TEXT_ON_PATH, 0) != 0);
       }
       if (text.drawOnPath == null) {
         text.bounds.offset(text.centerX, text.centerY);
         // shift to match alignment
         text.bounds.offset(-text.bounds.width() / 2, 0);
       } else {
         text.bounds.offset(
             text.centerX - text.bounds.width() / 2, text.centerY - text.bounds.height() / 2);
       }
       if (display) {
         rc.textToDraw.add(text);
       }
     }
   }
 }