Map

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
fatcharlieuk
Posts: 47
Joined: Tue Dec 22, 2020 7:42 am

Map

#1 Post by fatcharlieuk »

Hi all,

I'm making my first essays into map functions with the eventual goal of trying to produce something like a Garmin 530 (but probably a very simplified one).

I've seen Tony's video on Maps - but can't get anything to show other than the base map.

Code: Select all

map_id = map_add(0,0,512,512, "OSM_STANDARD", 8)

img_layer_id = map_add_nav_img_layer(map_id, "VHF_NAVAID", "VOR_Symbol.png", -7, -6, 14, 12)
txt_lyer_id =  map_add_nav_txt_layer(map_id, "VHF_NAVAID", "NAME", "color: red; halign:center", -35, 15, 200, 40)

map_goto(map_id, 50.949970245361,  -1.3620375394821)
The aircraft is at EGHI, hence the map_goto as i know there's a VOR there.

Anyone able to help? Or is there an updated version of the tutorial?

many thanks,

Roger.

User avatar
Keith Baxter
Posts: 4671
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Map

#2 Post by Keith Baxter »

Hi,

What you are trying will not work. The Nav type (AM4.x) you are using is not compatible with
map_add_nav_img_layer() and map_add_nav_txt_layer()

For AM4 up you must use
map_add_nav_canvas_layer()
And the nav types for AM4.x

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

fatcharlieuk
Posts: 47
Joined: Tue Dec 22, 2020 7:42 am

Re: Map

#3 Post by fatcharlieuk »

Thought it would be simple! I'll give that a go... thanks :-)

fatcharlieuk
Posts: 47
Joined: Tue Dec 22, 2020 7:42 am

Re: Map

#4 Post by fatcharlieuk »

Hm... still doing something wrong. I'm just using the example given in the API now.

Code: Select all

-- Place a map to your instrument using the openstreetmap cycle map and zoom level of 10
map_id = map_add(0, 0, 512, 512, "OSM_CYCLE", 10)

-- Add the canvas draw callback
function canvas_draw_callback(vhf_navaid_data)
  _circle(25, 25, 25)
  _fill("magenta")
  _txt(vhf_navaid_data["ICAO"], "font:roboto_bold.ttf; size:16; color: black; halign:center; valign:center", 25, 25)
end

-- Add a NAV layer of type "VHF_NAVAID". For every VHF_NAVAID station the canvas draw callback will be called.
layer_id = map_add_nav_canvas_layer(map_id, "AIRPORT", -25, -25, 50, 50, canvas_draw_callback)

map_goto(map_id, 52.422607, 5.485053)
image.png
I've tried different zoom levels, map types and also "nil" for the map type. I'm still not getting any canvasses drawn...

Any help appreciated. :-)

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: Map

#5 Post by Corjan »

Hi,


The image and text layers are still there and supported by AM 4.0.
AM 4.0 simply added an additional layer.

Note that for NAV data to work, you need to be connected to your flight simulator.


Corjan

User avatar
Keith Baxter
Posts: 4671
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Map

#6 Post by Keith Baxter »

@Corjan


Are you sure? I think there was a conversation that is different. I might have misinterpreted and be incorrect.

This is correct and I agree. "Note that for NAV data to work, you need to be connected to your flight simulator".

However the OLD nav data works not so well in AM4 (beta40), This example instrument works perfectly in AM3.7 but not in AM4
ice_screenshot_20210626-121059.png
ice_screenshot_20210626-121331.png
Image left working in AM3.7 Image right not working AM4 (beta 40)
ice_screenshot_20210626-122745.png
Please do not waist time trying to fix the old nav system to work on AM4. The new Nav system is far better.

I have purchased AM4 but decided not updated to AM4 because of this. I will use the beta until I can convert all my instruments from the old nav system to the new nav system.


Keith


EDIT: What is also interesting is the quality of the base map. AM3.7 base map has a lot more detail. Well at least they are inconsistent.
Last edited by Keith Baxter on Sat Jun 26, 2021 12:03 pm, edited 5 times in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4671
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Map

#7 Post by Keith Baxter »

@fatcharlieuk

As Corjan says, Sim must be running.

Works OK on AM4 (beta 40)
ice_screenshot_20210626-130116.png

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

fatcharlieuk
Posts: 47
Joined: Tue Dec 22, 2020 7:42 am

Re: Map

#8 Post by fatcharlieuk »

Weird! I have copied your code exactly, checked and double-checked ofr typos. But when I run it I get the same map as you, but no magenta circles. Is it possible I've managed to install AM without the navd data?

EDIT - I'm runnu=ing AM Home use 4.0.2 btw - maybe these functions aren't available on the home licence?

User avatar
Keith Baxter
Posts: 4671
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Map

#9 Post by Keith Baxter »

Hi,

It is possible it is broke in AM4 4.0.2.

I have not tried it in AM4.x due to the current instability both in the map and hardware aspects. IMHO AM3.7 and AM4 (beta 40) are excellent products and far more reliable and superior to AM4.x ATM. Just wish I could have AM3.7 and AM4.x running on the same machine.

I reported a bunch of map issues in AM4 beta regarding the old nav system and very few were fixed. The new NAV system seems to work OK in AM4 (beta 40).

There are a few of us, @Sling included that await for improvements to the NAV/MAP system. But it is all about priorities, and these features are used by few.

More and more peeps are venturing into the Garmin instruments with AM, so priorities might change. With this trend the SI guys might put more time into this aspect which I welcome.
Sling wrote: Mon Jun 21, 2021 9:07 am There is also a CDI. I was interested in this a while back but have put everything with a map or nav features on hold until the navigation features mature and I can find the time and motivation to revisit where I got to with the vector map work. I think someone else on the forum was looking at this also.

Tony
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply