<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GraphicsOverlay remove automatically points in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1029936#M2315</link>
    <description>&lt;P&gt;There are 2 rendering modes for graphics overlays.&amp;nbsp; The default is "Dynamic" which gives you a nice user experience when zooming in and out where the symbol size is animated as you change scale.&amp;nbsp; This is however expensive on GPU resources so if you've got almost 2 million graphics you will run out of resources.&amp;nbsp; The other mode is "Static" which I recommend if you have very large numbers of graphics.&amp;nbsp; It doesn't look as nice when you zoom in or out, but it makes better use of our hardware resources.&lt;/P&gt;&lt;P&gt;I've tried this out in a little app I've written just now.&amp;nbsp; In dynamic mode it failed to render all points correctly, but switching to static makes it draw correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;    private void addLotsOfGraphics() {
        // static rendering is best for very large number of graphics
        graphicsOverlay = new GraphicsOverlay(GraphicsOverlay.RenderingMode.STATIC);
        mapView.getGraphicsOverlays().add(graphicsOverlay);


        Collection pointsList = new ArrayList&amp;lt;&amp;gt;();

        Random random = new Random();

        // using a simple marker symbol and applying this to a renderer for graphics overlay
        SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFF00FF00, 10);
        SimpleRenderer simpleRenderer = new SimpleRenderer(simpleMarkerSymbol);
        graphicsOverlay.setRenderer(simpleRenderer);

        // add lots of graphics in random places
        for (int i=1; i&amp;lt;2000000; i++) {
            // random point
            Point point = new Point(random.nextDouble() * 10000000, random.nextDouble() * 10000000);
            Graphic graphic = new Graphic(point);
            pointsList.add(graphic);
        }

        // add the graphics to the graphics overlay
        graphicsOverlay.getGraphics().addAll(pointsList);
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 10:31:30 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2021-02-24T10:31:30Z</dc:date>
    <item>
      <title>GraphicsOverlay remove automatically points</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1029932#M2314</link>
      <description>&lt;P&gt;Hi, how are you?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one pointcollection with&amp;nbsp;1742863 points, when add it to GraphicsOverlay:&lt;/P&gt;&lt;P&gt;graphicsOverlay.getGraphics().addAll(pointcollection);&lt;/P&gt;&lt;P&gt;The MapView (with resolution&amp;nbsp;2614x1469) reflect the drawing, but almost seconds later several points (I ignore amount) are removed and not showing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This has to do with performance and equipment ? I have one equipment with 16gb ram and intel processor i5-7400.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1029932#M2314</guid>
      <dc:creator>Juance20</dc:creator>
      <dc:date>2021-02-24T09:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicsOverlay remove automatically points</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1029936#M2315</link>
      <description>&lt;P&gt;There are 2 rendering modes for graphics overlays.&amp;nbsp; The default is "Dynamic" which gives you a nice user experience when zooming in and out where the symbol size is animated as you change scale.&amp;nbsp; This is however expensive on GPU resources so if you've got almost 2 million graphics you will run out of resources.&amp;nbsp; The other mode is "Static" which I recommend if you have very large numbers of graphics.&amp;nbsp; It doesn't look as nice when you zoom in or out, but it makes better use of our hardware resources.&lt;/P&gt;&lt;P&gt;I've tried this out in a little app I've written just now.&amp;nbsp; In dynamic mode it failed to render all points correctly, but switching to static makes it draw correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;    private void addLotsOfGraphics() {
        // static rendering is best for very large number of graphics
        graphicsOverlay = new GraphicsOverlay(GraphicsOverlay.RenderingMode.STATIC);
        mapView.getGraphicsOverlays().add(graphicsOverlay);


        Collection pointsList = new ArrayList&amp;lt;&amp;gt;();

        Random random = new Random();

        // using a simple marker symbol and applying this to a renderer for graphics overlay
        SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFF00FF00, 10);
        SimpleRenderer simpleRenderer = new SimpleRenderer(simpleMarkerSymbol);
        graphicsOverlay.setRenderer(simpleRenderer);

        // add lots of graphics in random places
        for (int i=1; i&amp;lt;2000000; i++) {
            // random point
            Point point = new Point(random.nextDouble() * 10000000, random.nextDouble() * 10000000);
            Graphic graphic = new Graphic(point);
            pointsList.add(graphic);
        }

        // add the graphics to the graphics overlay
        graphicsOverlay.getGraphics().addAll(pointsList);
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 10:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1029936#M2315</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-02-24T10:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicsOverlay remove automatically points</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1031286#M2316</link>
      <description>&lt;P&gt;Thanks, works perfectilly. D&lt;SPAN&gt;id not know the rendering modes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 17:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/graphicsoverlay-remove-automatically-points/m-p/1031286#M2316</guid>
      <dc:creator>Juance20</dc:creator>
      <dc:date>2021-02-27T17:07:05Z</dc:date>
    </item>
  </channel>
</rss>

