CIQ 3.0 MapView request for feature

Since nearly 2 weeks I'm playing with new cool feature allowing to present map and custom content over it… (even I though - I THOUGH that I found bug - sorry guys - my fault!)

There is thing I cannot resolve and I believe - it is not possible to do without extending (at least slightly!) API -

- I'm trying to draw something more complicated than an icon on map, not going into details - this is a dynamic drawing using BufferedBitmap
My assumption was - I'll convert geographic coordinates to screen coordinates using known top_left / bottom_right mapped to the screen… WRONG
- I have realized that top_left / bottom_right coordinates are NOT mapped to the extent of the screen, but additional border is added (unknown) - of course I am using setScreenVisibleArea to the full extent of screen (maybe if I'd map to smaller part - there would be no border added to map? I don't know… I'm already taking care of screen aspect ratio btw)

Above means - I don't know what border is added around top_left/bottom_right - therefore I won't be able to convert screen coordinates to geographic coordinates and place BufferedBitmap correctly on the screen.

What would help? Any from below -

1. Simplest - lets allow to read from MapMarker screen coordinates - that way I'd be able to map screen coordinates to geographic coordinates (by even placing a single pixel)
2. Add any function to do the mapping of coordinates (maybe that would be even simpler?)
3. Extend MapMaker to accept not only icon but BufferedBitmap :) - I know, that could be little too much

I don't know is such feature would be found useful for the others… I - personally - would love to have it…

OR maybe - there is a way to do the mapping?

Thanks guys!
  • From what I understand a few things here:

    the border.
    there's MapView.setMapVisibleArea(top_left, bottom_right); that defines the area of the map you're starting with, and then there's MapView.setScreenVisibleArea(20, 20, Screens.width-20*2, Screens.height-20*2); that sets the focus for where that is on the screen. In this case, I'm saying I want a 20 pixel border on all for sides.

    Plus given that, top_left, bottom_right might not be all that's in that area, as the map keeps it's scale.
    When I said "you're starting with", because pan/zoom can also come into play - setMapMode(Ui.MAP_MODE_BROWSE);

    so, even with the location and x,y screen coordinates of upper_left and bottom_right, it's not simple to do, and then if you add pan/zoom, really hard. But a marker handles that, as the native view understands those and handles things. And more than likely, may only understand the bitmap used for the marker. I doubt the native view would know what to do with a buffered bitmap.

    Transparency of text overlaying the map is discussed here and I'd expect the same if you tried drawing your own thing.

    One of the Garmin folks may correct me here.. :) I'm just figuring out stuff myself...
  • Former Member
    Former Member over 6 years ago
    The extra border you are seeing is due to the fact that the map only has a limited set of discrete zoom levels. The map will automatically zoom out to the largest zoom level that fits the specified bounding box within the visible screen area. The zoom levels that are available are specific to the map engine settings on each individual product, and are not emulated by the simulator.

    Within the existing implementation, the only way to achieve the results you are looking for is to reverse engineer the zoom levels for a specific device and determine what the zoom scale would be for a given scenario.

    There is one way to provide a BufferedBitmap to the MapMarker class currently. To do so, you must generate the BufferedBitmap from a BitmapResource. If you know the size of canvas you need for this application you can include a blank resource, use it to initialize a BufferedBitmap, and then use the original loaded resource as the argument to the MapMarker. The BufferedBitmap and BitmapResource will reference the same canvas in this scenario. I've created a feature request ticket to add an accessor to the BitmapResource that backs a BufferedBitmap. I think this is something reasonable to expose.
  • Brian,

    THIS IS WORKING ! :)

    I'd never guess that referring to bitmapResource used as initializer for BufferedBitmap would result in referring to modified BufferedBitmap -
    it would be worth of mentioning somewhere in the documentation. That way I am ableto place custom drawing using geographic coordinates - what was my original aim!

    Still however I think that cleaner solution would be to allow to place directly BufferedBitmap (as functionality in fact exist!)

    BTW - it is working with CIQ 3.0.0 beta3 - freshly installed today.

    One comment regarding transparent text - that was one of my first observation - that transparency is not honored, so I have implemented custom bitmap digits draw to ensure transparency…

    Thanks again for help!
  • Former Member
    Former Member over 6 years ago
    If the resource initializer didn't work this way, creating a BufferedBitmap from one would incur a large memory hit when the canvas was duplicated.

    It makes sense for BufferedBitmaps to be accepted anywhere a BitmapResource is, but it is more likely we add a getter for the BitmapResource in the BufferedBitmap class to enable this support for all our older APIs without having to update their input handling.

    Regarding transparent text. I just found out that this is not an issue on our hardware integration, and I am fairly certain I can fix it for the simulator, so if all goes well, that will not be an issue.
  • Brian,

    There is one more missing feature in MapView - I believe you'll agree

    For MapView - when you're in BROWSE mode - you can select any area of map manually - but then - there is no API to get information what area is visible on he screen… something like getMapVisibleArea ?

    To interact with map - especially if I'm downloading some additional data to place over the map - I need to know visible area.

    For Track view- there is no such issue - I can read at least my current location (not perfect - as still I don't know what area is visible).

    Thanks
  • Brian,

    There is one more missing feature in MapView - I believe you'll agree

    For MapView - when you're in BROWSE mode - you can select any area of map manually - but then - there is no API to get information what area is visible on he screen… something like getMapVisibleArea ?

    To interact with map - especially if I'm downloading some additional data to place over the map - I need to know visible area.

    For Track view- there is no such issue - I can read at least my current location (not perfect - as still I don't know what area is visible).

    Thanks


    I've put in a feature request to be looked at by our engineering team.

    Thanks,
    - Coleman
  • You say with MapTrackView you see a current location, but not with MapView? Are you using GPS to get the location? Otherwise, as best, MapTrackView is using a old location to center the map, or centering just based on the setMapVisibleArea.

    In my test app, I use GPS, and every 30 secs or so, save the location and use that array to draw a polyline, so I always have the current location, and draw a marker there. You'll also get the pointer thing on a real device at the current location. The sim may show the pointer thing with MapTrackView, but I know it doesn't with MapView
  • Well, with MapView you can browse any location (this is my understanding + observations so far). Of course I can see arrow for last location - but as long as GPS is not started - I guess - nothing is forced?

    Anyway - I can initiate any area for the map - user can then browse - so how I can then know what location is visible? That's the problem.

    However I have noticed something else - don't know if by design or due to beta

    - after switching back from browse to preview map - Zoom is preserved, but not location, so maybe my request is useless? Don't know yet - have to make more tests...
  • If you know your location, why not use data for say a mile in diameter? Even if that location isn't visible on the screen you can add a marker that will be seen with a pan/zoom, with no delay if you're getting the data from the internet..
  • Jim,
    I don't necessary want to show my current location - that's the clue. User can enter any location name - and I'll show respective map area and overlay meteo map on top. For that I need to know what's visible on the screen to query correct data.