A picture shows a floor plan, I can add on a lot of hot spots (like baidu map marker), there are many kinds of color, this hot spot can (or moves to the above), when the mouse click can display detailed information about the hot spots,
At the same time when zooming, hot also keep moving,,,,
Want to a night didn't know what good idea, don't write code for a long time, haven't got the,,, you don't too few,,,,,,,,,, -- -- -- -
CodePudding user response:
This is a similar map platform or the development of CAD platform, controls inherit from usercontrol, equivalent to in the white paper on development, realize the images load, scale development, realize the hot spots to add, delete development, is based on the need to implement the coordinate transformation development,CodePudding user response:
Establish such a data structure,Public class hot information
{
Public Button obj.//control is used to display the hotspot, what controls can casually, can be in either shape or a picture box control
Public Point p;//control the upper left corner the coordinates relative to the parent control
Public string tip;//message
}
1, when creating a hot, a hot information dynamically generated classes, a hot information added to the class of the collection,
2, when moving the mouse on the map, traverse a collection, to see if a hot
If (x> Class=hot information. P.x & amp; & x
//hot hit, and then display the information
}
3, when zooming, according to the dynamic scaling change all hot information class p
New p.x=old p.x * (new width/old map width);
New p.y=old p.y * (new height/old map height);
To provide a train of thought, can help to this,
CodePudding user response: