1 Reply Latest reply: Feb 20, 2012 11:15 PM by CharlesW RSS

    I can't highlight FOI in a circle with mapviewer!

    918148
      Excuse me,I came with a question like this:
      At frist ,I added a basemap:linshi.demo_map;
      Then,I added a themebasefoi:linshi.cp_u_p;
      and then I'd like to draw a circle to highlight the foi in it.
      But when I had finished drawn the circle , an error appeared like this :

      2012-02-17 15:01:28.015 NOTIFICATION [ CP_U_P ] SpatialOp sql exec time: -132946
      2087953ms, total time loading 0 features: 78ms.
      2012-02-17 15:01:28.062 ERROR MAPVIEWER-06009: 处理 FOI 请求时出错。

      I wonder why would the err appear.Thanks for your answers!
        • 1. Re: I can't highlight FOI in a circle with mapviewer!
          CharlesW
          Please see the below code for highliting FOIs using a circle:

          function addCircleTool()
          {
          var sc1 = new MVStyleColor("color1", "0000ff","003333");
          sc1.setFillOpacity(0.2);
          circleTool = new MVCircleTool(sc1);
          circleTool.setPlotDivFillColor("#0000FF",0.5);
          mapview.addCircleTool(circleTool);

          circleTool.init();
          circleTool.attachEventListener(MVEvent.FINISH,circleToolDone)

          }

          function circleToolDone()
          {
          circle=circleTool.getCircle();

          highlightCustomers(circle);
          }

          function highlightCustomers(geom)
          {
          hilitedCustomers = new MVThemeBasedFOI('highlightedcst','mvdemo.customers');

          hilitedCustomers.setBringToTopOnMouseOver(true);

          hilitedCustomers.setHighlightOnly(true);
          hilitedCustomers.setFilteringGeom(geom);
          hilitedCustomers.setRenderingStyle("M.CYAN PIN"); //set the pin symbol as the highlight style

          mapview.addThemeBasedFOI(hilitedCustomers);
          }