raptorswing / MapGraphics

A tile-based "slippy map" library written in/for C++/Qt. It's meant to enable C++/Qt developers to easily add nice, interactive maps to their applications. Supports zooming, rotating, interactive custom map objects, transparency, etc. It is a Qt map widget that can use tiles from MapQuest, Openstreetmap, or a custom source you define.
Other
163 stars 77 forks source link

using maker and drawing points #14

Open EmbeddedAndMore opened 9 years ago

EmbeddedAndMore commented 9 years ago

hi. it's not actually an issue . after a lot searching i found your code vary suitable for my job because, 1- it can saves the tiles and use the map without network. 2- it's simple 3- it's written in c++ and Qt(my code is in Qt too)

so, is there any possibility i can 1- use marker when i double click some where in map .?? 2- draw some color points in map with it's coordinate ??

ow can i get the coordinate of the point in map where i double click on it ??

any help would be great.

thanks in advance. MA.

raptorswing commented 9 years ago

Hi,

Glad that you have found this code helpful.

The easiest way might be to write a class which inherits MapGraphicsView and overrides the virtual mouse-handling events in that class.

There is an example of this in another one of my projects (which consumes this project) here: https://github.com/raptorswing/FlightPlanner/tree/UserStudy/WaypointPlanner/gui

See the "WaypointMapView" class.

Hopefully this helps.

EmbeddedAndMore commented 9 years ago

thanks raptorswing for the response . in last 2 3 days i was working on your code , that's really good, i add waypoints by double click , remove points, make a polygon with those points, and also changed it's server to Bing satellite server.

there was some problem to convert cursor position to latitude and longitude(find method in your code),well because of my weakness :)
although i'm not so good in ObjectOriented and inheritance but i did something :)

last night i was thinking it will be grate if it's possible to add markers(instead of points(circles)) and sequence number of marker added to map beside it's marker (for waypoints,) and/or another .png image as UAV(multirotor) . now it is : 2-25-2015 2-06-48 pm

and i want to be : 2-25-2015 2-11-10 pm

is it possible now with current code?? if not , any help would be grate

raptorswing commented 9 years ago

Hi,

Yes, it's definitely possible to add custom markers for a series of points. It looks like you've experimented with the PolygonObject provided in MapGraphics. This may not be the best choice for representing the flight path of a UAV since PolygonObject will always make a loop.

When I was working on a similar effort I represented a UAV's flight path as a series of connected LineObject objects. I used a wrapper class to manage the LineObjects based on inputs (adding a new waypoint, deleting a waypoint, moving a waypoint, etc.).

These might be helpful as examples: https://github.com/raptorswing/FlightPlanner/blob/UserStudy/PlanningCommon/WaysetDisplayManager.cpp https://github.com/raptorswing/FlightPlanner/blob/UserStudy/PlanningCommon/MapObjects/Waypoint.cpp

In fact, you might be able to get some reuse in general out of the WaypointPlanner sub-project here: https://github.com/raptorswing/FlightPlanner/tree/UserStudy . If you build the top-level FlightPlanner project you should be able to run WaypointPlanner and get some context.