By browsing github I found out how to use the NavSat plugin (ignition-gazebo-navsat-system if that was unclear).
So basically you have to do something like this if you are using SDF:
<model name="NavSat">
<pose>0 0 0.05 0 0.0 0</pose>
<link name="link">
<inertial>
<mass>0.1</mass>
<inertia>
<ixx>0.000166667</ixx>
<iyy>0.000166667</iyy>
<izz>0.000166667</izz>
</inertia>
</inertial>
<collision name="collision">
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</visual>
<sensor name="navsat" type="navsat">
<always_on>1</always_on>
<update_rate>1</update_rate>
<topic>navsat</topic>
</sensor>
</link>
</model>
For this to work you also need to set the spherical coordinates for navsat. I did this is in my world SDF file, and it looks like this:
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<world_frame_orientation>ENU</world_frame_orientation>
<latitude_deg>-22.986687</latitude_deg>
<longitude_deg>-43.202501</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
However, I was not able this from an URDF file, which is what I want to do.
EDIT:
If you are using ROS2 you can call the service /world/world_name/set_spherical_coordinates service from your launch.py file to set the spherical coordinates.