Pitney Bowes Business Insight: SitePass Global Navigation Bar

Home » Pitney Bowes Business Insight Community Discussion Forums » MapXtreme for Java

Thread: Use CompositeRenderer in visualMapJ


Permlink Replies: 5 - Last Post: Feb 5, 2010 12:02 PM by: basu saha Threads: [ Previous | Next ]
Marcos Hernandez

Posts: 7
Registered: 12/3/02
Use CompositeRenderer in visualMapJ
Posted: Mar 12, 2007 1:17 PM
  Click to reply to this thread Reply

I can use the CompositeRenderer in VisualMapJ? How?

I write a program with an animated layer, but when i repaint the visualMapJ all layer are repainted. The sample in the documentation is for a Servlet, but i use visualMapJ. Thanks for your help

-

Posts: 75
Registered: 1/17/07
Re: Use CompositeRenderer in visualMapJ
Posted: Mar 13, 2007 5:20 PM   in response to: Marcos Hernandez
  Click to reply to this thread Reply

[nobr]Hello Marcos,

It should be possible to use the CompositeRenderer with a VisualMapJ object.  Every VisualMapJ object has an underlying MapJ object which is accessed using the getMapJ() method of the VisualMapJ object.
For Example:

If vMapJ is a VisualMapJ object, you will get its MapJ object using the following code:
MapJ myMapJ = vMapJ.getMapJ();

You can then treat myMapJ like any other MapJ object.  So, to create a CompositeRenderer you would use the following lines of code (considering the example I gave above):

ImageRequestComposer imageRC = ImageRequestComposer.create( myMapJ , ImageRequestComposer.MAX_COLORS_TRUECOLOR, Color.Blue, "image/gif");

CompositeRenderer compRenderer = new CompositeRenderer(
http://localhost:8080/mapxtreme480/mapxtreme, 0);

compRenderer.render(imageRC);

Let me know if you have any trouble with this.

Thanks,
Kelly
MapInfo Technical Support
[/nobr]

Marcos Hernandez

Posts: 7
Registered: 12/3/02
Re: Use CompositeRenderer in visualMapJ
Posted: Mar 14, 2007 1:03 PM   in response to: Marcos Hernandez
  Click to reply to this thread Reply

Thanks for your answer.

I put this code in the init from my Jframe. This run fine, but this not resolve my problem. I think my problem is in refresh the visualMapJ.

I write a Timer in Java and i execute an Action every five seconds. In the body of the action i put the code:

visualMapJ.repaint();

This generate a terrible blink Map. I like refresh only the car in my map.

I think i mabe repaint only the rectangle of the car, but i dont know how convert my geographics coords to Image coords.

Thanks



-

Posts: 75
Registered: 1/17/07
Re: Use CompositeRenderer in visualMapJ
Posted: Mar 15, 2007 5:08 PM   in response to: Marcos Hernandez
  Click to reply to this thread Reply

Hello Marcos,

You are welcome.  Calling repaint on the VisualMapJ will redraw the whole VisualMapJ. 
You may want to refer to the section titled "Composite Renderer" in Chapter 11("Rendering Considerations") of the MapXtreme Java Developer Guide for additional information.

As for converting geographic coordinates to image coordinates, see the transformNumericToScreen function of the MapJ class.  As said in the API, this method "transforms point data from the numeric coordinate system to the screen coordinate system (pixels)."  You can provide either a point or a rectangle as a parameter to this method.  There is also a transformScreenToNumeric method.

Thanks,
Kelly
MapInfo Technical Support

-

Posts: 5
Registered: 7/22/09
Re: Use CompositeRenderer in visualMapJ
Posted: Jul 23, 2009 12:30 PM   in response to: Marcos Hernandez
  Click to reply to this thread Reply

please i need all your code to add a picture on a map whith java and visualmapj


basu saha

Posts: 3
Registered: 2/5/10
Re: Use CompositeRenderer in visualMapJ
Posted: Feb 5, 2010 12:02 PM   in response to: Marcos Hernandez
  Click to reply to this thread Reply

[nobr]
hi !!!


its really a informative post...


thanks for your information ...........





<table border="0" cellspacing="0" cellpadding="0" width="72" style="border-collapse: collapse; width: 54pt"> <tbody> <tr height="20" style="height: 15pt"> <td class="xl66" width="72" height="20" style="height: 15pt; width: 54pt"> buick park avenue superchargers </td> </tr> </tbody></table>
[/nobr]

Legend
Helpful Answer
Correct Answer



Global Navigation Bar