Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] How to use MapGraphic to draw a graph

There is also the "glass pane" which is used to render with draw2d over top of the rest of the rendering system. See the "tracking" tutorial here for an example: http://udig.refractions.net/confluence/display/DEV/2+Training+Materials

The interesting part for you will be sorting out if your zoom in / zoom out bar is clicked on. I am not quite sure how you want to handle that?

Jody

-- 
Jody Garnett

On Thursday, 17 February 2011 at 8:09 PM, andrea antonello wrote:

Does the mapgraphic appear in the list of decoration objects?
You have to pull it on the map to be drawn.

Andrea

On Thu, Feb 17, 2011 at 4:42 AM, Fred Chen <fredcfz@xxxxxxxxxxx> wrote:
Hi,

I want to implement a zoom in/zoom out bar. It is something like the
vertical bar in google maps. The map will be zoom in or out when users
clicks on the bar.

I am trying to implement the net.refractions.udig.mapgraphic.MapGraphic
interface to draw the bar. So I followed the
net.refractions.udig.tutorials.mapgraphic example and created my own
mapgraphic.

Firstly, I created ZoomBarMapGraphic class which implements MapGrahic

        public class ZoomBarMapGraphic implements MapGraphic{

              @Override
               public void draw(MapGraphicContext context) {
                     //draw the zoom bar here
               }
        }

Secondly, I added the class to the  extension point:
net.refractions.udig.mapgraphic.mapgraphic
<extension
         point="net.refractions.udig.mapgraphic.mapgraphic">
      <mapGraphic

class="net.refractions.udig.tutorials.customapp.ssds.ZoomBarMapGraphic"
            id="net.refractions.udig.tutorials.customapp.mapGraphic1">
      </mapGraphic>
   </extension>

And then, I try to run the application. But It didn't draw anything.
Actually, the ZoomBarMapGraphic.draw(MapGraphicContext context) method is
not called.

Do I miss anything here? Can anybody help me out of here?

Thank you in advance.

Derek

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top