How to add a map in dart? - game-engine

I'm gonna add a 2d game's map in dart,
I use this map design by tile map.
How can i add in dart and display on html ??
Or is there any method to create game's map in dart?

For historical reference, this is answered in greater detail on the dart mailing list:
https://groups.google.com/a/dartlang.org/forum/#!topic/misc/-gwxJiVNBoI

Related

Measure fields and area using google maps api in react native

I want to implement a feature in my react native application to let the user measure area or fields with two different methods the first is manual like manually drawing the fields area in the map and secondly automatically by using the gps and entering points while he walk around the field .
Could please anyone share some resosurces or any help material that may assist me in achieving this feature.
Thanks in advance
It is totally doable. Since you didn't mention any particular library, let me explain using react-native-maps (it is an awesome package :). Let's first discuss using the drawing (not sure if you literally mean drawing - at least I don't think you need to add complexity in this).
You can provide the <MapView> component provided by the package with a onTap method, when the user taps, you can add the coordinate a list of coordinates like this:
const [coordinates, setCoordinates] = useState([]);
then in the map, you can do
<MapView onPress={(coords) => setCoordinates([...coordinates, coords])} ...rest of the code
when the user is done, you can use a bit of mathematics (https://www.mathopenref.com/coordpolygonarea.html) or even a polygon package to calculate the area (https://www.npmjs.com/package/polygon).
Well, the second use case is easier I think as no extra interaction is needed since user can input the coordinates which you can again put in the coordinates array and use to calculate area.
I hope it helps :)

Imagemap usage in qml

Is there any way to build an image map with qml (qt quick) components directly without importing html code?And I want to it's coordinates be same as html imagemap's coordinates(I dont want to recalculate my image map coords).
and
my shape is rectangular.tnx
No, there is no way. MouseAreas are always rectangular.
You would need to provide a some kind of collision detection function, to check whether your click happened inside of your object, described by the coordinates.
For this you can implement any of the algorithmns out there, in a way, that it supports your coordinate format. The right choice depends on the characteristics of your objects, like:
Is it a circle?
Is it a regular shape?
Is it convex?
Is it concave?
There are many good pages on collision detection, though a performant implementation might be tricky - especially in QtQuicks JS, so you probably want to do it in C++.
Another shot you might take, is dropping your coordinates, and produce masks that can be used with the solution provided here: https://stackoverflow.com/a/38177820/2056452 (coming from an official example)

Having google and apple maps in the app

I'm using Apple Maps as default maps in my view.
I would need to integrate Google Maps in my app, and give users to select type of map:
Google Map or Apple Map.
I have different methods, which show radius overlay, pins, and other thing. Is there any ways to have 1 MapView, and just to change type of the map? google or apple.
Whats is the best practice with integration both maps to the app.
You won't be able to simply use both different maps and switch between them because they do not share the same API, or even a similar API. This means that every single piece of information needs to be handled appropriately for each individual map because annotations and overlay are handled differently on each map. My recommendation would be to use UIViewControllerContainment, create a class, something like VRMapViewController, put the methods this class needs to implement in order to have some data added/removed, and then implement two subclasses: VRAppleMapViewController and VRGoogleMapViewController. In this subclasses you will handle the customization needed for each control in order to present the data inside the map (configuring annotations and overlays, etc). Each class will also handle delegate callbacks from their respective map views.

how to highlight countries in ios maps

I am building an app in which I have to highlight some countries dynamically in the world map.
In short I want to customize the whole view of ios maps as shown in the images.
can this be done using MapKit or is there any other method. Thanks in advance
You want to look into the Mapbox iOS SDK which will allow you to do this and more with a MapKit-like API. In particular, you will want to quickly make a custom map with TileMill using the provided Natural Earth data set for world country borders, enable UTFGrid interactivity so that the tapped regions can be identified, and use the RMShape class on an RMAnnotation onto the map view to add/color country polygons as needed. This sounds a little complex but the tools exist, are entirely free and open source, and I can help you with this process.

Drawing maps without base images

I would like to draw a series of maps in an iOS application. Preferably, without using any image files as a base.
For example, I want to draw a map of the United States with states and counties outlined. Does anyone know of a way to do this?
By draw, I mean draw the map in code. Maybe using Apple's Map kit API?
You might want to look in here
http://planet.openstreetmap.org
to get the data. Then you can use the 2d graphics libraries to draw it.