×
Namespaces

Variants
Actions

Talk:Displaying Nokia Maps in a Form in Java ME

From Nokia Developer Wiki
Jump to: navigation, search

Contents

Hamishwillee - Excellent work! Subedited

Hi Adarsha,

As a document, this is VASTLY improved over your previous efforts: what you are trying to achieve is clear, and how to get there is explained logically. I cannot speak for the "technical content", but I would have said this was very useful.

I have subedited this and I suggest you have a look and check that you agree the changes are improvements. I believe so, but what you had was pretty good already! The main changes are:

  • Abstract - more succinct and better for determining if the article is likely to be relevant. At this level people don't know or care what a mapcanvas is - they just want to know what the article allows you to do
  • I pulled the "architectural" discussion on why you did things this way into the top of the "Development" section. I believe it is better to explain it here than in the sections describing the classes themselves
  • Put the classes under their own headings - makes it easier to read
  • The snapshots are now in a "gallery" - this is standard wiki format for listed images.
  • The development section also "defines" mapcanvas as the object that the API draws to.

The only thing that I think needs to change is the title. As for the Abstract, people who want to use Maps in a form will search/browse for a title that says something like that - not necessarily "MapCanvas" and CustomItem. I suggest you change the topic title to "Displaying Nokia Maps in a Form in Java ME"

Regards

Hamish

hamishwillee 09:02, 10 August 2012 (EEST)

Adarsha saraff - Thanks

Hello Hamish,

Thanks for the edits....:)

adarsha_saraff 12:38, 10 August 2012 (EEST)

Hamishwillee - Technical review

Technical reviewer says this is a good article, but unfortunately it repeats a lot of content in this article by Jappit: Creating a custom Map Item with Maps API for Java ME

This creates a static custom map item. It would be preference to using RESTful maps API since less downloading is involved. jappit’s article exposes an underlying MapDisplay which means the location, zoom and MapObjects can be added easily.

  • Note - your article "hides" the map, so first suggestion by technical expert was to extend to allow the map to be updated.


This function has a few issues:

public void setMap(double lat, double lon, String title){
map.getMapDisplay().removeAllMapObjects();
map.getMapDisplay().reconnect();
map.getMapDisplay().setCenter(new GeoCoordinate(lat, lon, 0));
map.getMapDisplay().setZoomLevel(4, 0, 0);
map.getMapDisplay().addMapObject(map.getMapFactory().createStandardMarker(new GeoCoordinate(lat, lon, 0), 1, title, 2));
}

I would change the signature to use GeoCoordinate – but this wouldn’t be an issue if it just exposed the MapDisplay anyway.

The only difference in the approach is whether the CustomItem should be based on a MapDisplay or a MapCanvas. Jappit’s uses the MapDisplay and hence doesn’t leave the standard MapComponents on screen. The new one uses MapCanvas and hence leaves half of an unusable zoom button on screen.

For the code as is, using the MapDisplay is preferred, since the Map is not interactive.

Other suggestions - if you update this code to expose a MapCanvas and get the canvas to respond to events then this would be something new. It would allow a user to interact with a small map on a Form.

As a minor suggestion

map.removeMapComponent(map.getMapComponent("ZoomImgComponent"));
map.removeMapComponent(map.getMapComponent("DownloadIndicator"));
Would get rid of the zoom button and number in the top right of the screen.

hamishwillee 03:24, 13 August 2012 (EEST)

Adarsha saraff - Fixed it.

Thanks Hamish,

Didn't noticed existing article. But now I fixed it. Now user can perform all the map operations like Zoom in, Zoom out and pan.

public void setMap(double lat, double lon, String title){
             map.getMapDisplay().removeAllMapObjects();
             map.getMapDisplay().reconnect();
             map.getMapDisplay().setCenter(new GeoCoordinate(lat, lon, 0));
             map.getMapDisplay().setZoomLevel(4, 0, 0);
             map.getMapDisplay().addMapObject(map.getMapFactory().createStandardMarker(new GeoCoordinate(lat, lon, 0), 1, title, 2));
}

This function is to demonstrate how you can set the map. It is not necessary that you need to use same statements as in above in setMap() method.

adarsha_saraff 14:51, 13 August 2012 (EEST)

Hamishwillee - Thanks!

Hi Adarsha

I've asked for further review, but looks like improvement to me! I've added a SeeAlso link to the related article.

In terms of previous suggestions you might want to "change the signature to use GeoCoordinate" rather than lon and lat.

In terms of "further improvements". Given that we know there is another way to do this, it is worth having a section outlining what it is that this method does compared to the other article, and why you might use this approach.

Regards

Hamish

hamishwillee 04:57, 15 August 2012 (EEST)

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×