सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Universe एक Flutter पैकेज है जो फ्लटर एप्लिकेशन में इंटरैक्टिव मानचित्र को आसान और लचीला तरीके से एकीकृत करने का तरीका प्रदान करता है, जिसका प्रेरणा Leaflet.js से लिया गया है। यह डायनामिक मानचित्र रेंडरिंग, कस्टम मार्कर और कई प्लेटफॉर्मों पर टच इंटरैक्शन का समर्थन करता है। हल्के एपीआई और प्रतिक्रियाशील डिज़ाइन के साथ, यह विकासकर्ताओं को न्यूनतम सेटअप के साथ समृद्ध भौगोलिक अनुभव बनाने में सक्षम बनाता है। यह पैकेज मानचित्र दृश्यीकरण, स्थान ट्रैकिंग या अंतरिक्ष डेटा प्रतिनिधित्व की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है।
उपयोग
इंटरैक्टिव मानचित्र प्रदर्शन
स्थान-आधारित ऐप विशेषताएँ
भूस्थानिक डेटा दृश्यकरण
मैप ओवरले और अनोटेशन
रियल-टाइम ट्रैकिंग इंटरफेस
मुख्य विशेषताएँ
प्लेटफॉर्म के अनुकूलता
कस्टमाइज़ किए गए मानचर्य परतें
स्पर्श इंटरैक्शन समर्थन
हल्का और स्वचालित API
मार्कर और पॉपअप का समर्थन
इनके लिए उपयुक्त
मोबाइल ऐप विकासकर्ता
ज्योग्राफिकलोकेशन फीचर कार्यान्वयनकर्ता
डेटा विज़ुअलाइज़ेशन प्रोजेक्ट्स
इंटरैक्टिव मानचित्र के प्रोटोटाइपिंग
विचार योग्य बातें
मानचित्र टाइल्स के लिए इंटरनेट कनेक्शन की आवश्यकता होती है
सीमित ऑफलाइन मानचित्र क्षमता
बाहरी मानचित्र प्रदाताओं पर निर्भर
बड़े डेटासेट के लिए प्रदर्शन समायोजन की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Universe
The easy & flexible way to use interactive maps in Flutter.
Supports OpenStreetMap, Google Maps, MapBox and more.
// List of available OpenStreetMapType// OSM MapnikOpenStreetMapType.Mapnik// OSM GermanyOpenStreetMapType.DE
// OSM SwitzerlandOpenStreetMapType.CH
// OSM FranceOpenStreetMapType.France// Humanitarian OSMOpenStreetMapType.HOT
// OSM BretonOpenStreetMapType.BZH
U.MapBox(
// get your access token from https://account.mapbox.com/access-tokens/
accessToken: '',
center: [-6.175329, 106.827253],
type: MapBoxType.Street,
zoom: 15,
)
You can get your own MapBox access token from here. Please always use your own access token in your projects.
// List of available MapBoxTypeMapBoxType.BasicMapBoxType.StreetMapBoxType.SatelliteMapBoxType.HybridMapBoxType.OutdoorsMapBoxType.DarkMapBoxType.LightMapBoxType.Bright
We can create maps with multiple tile layers. Here is an example of using Humanitarian OpenStreetMap combined with map tiles from SafeCast and OpenRailwayMap.
The default behavior of Live Map is always move the center of the maps to user's current location.
If you want to go live (always searching for user's current location and show location indicator to that location), but don't want to move the center of the maps, you can set parameter moveWhenLive to false.
U.GoogleMap(
type: GoogleMapType.Street,
center: [-6.169976, 106.830979],
zoom: 16,
live: true,
// moveWhenLive: false will make the map live (constantly search for user location),// set the location indicator to current user location, but does not // move the center of the maps automatically to that location.// moveWhenLive has default value set to true
moveWhenLive: false,
)
And use that controller to listen the positionStream to get current position and current zoom of our map. We can also programmatically move, zoom, rotate or find location using the map controller.
// listen everytime the map data changes (move or zoom)
_mapController.positionStream?.listen((data) {
// current center of the map// print(data.center); // current zoom level of the map// print(data.zoom);
});
Here is a simple example of painting a rectangle to universe maps.
U.OpenStreetMap(
center: [51.555015, -0.108331],
zoom: 16,
// by default, RectangleLayer will use style from theme primaryColor
rectangles: U.RectangleLayer(
[
[51.554488, -0.108964], // latlng of bottom left corner
[51.555682, -0.107580], // latlng of top right corner
],
),
)
Here is an example of painting an image overlay to universe maps.
U.OpenStreetMap(
center: [-6.175329, 106.827253],
zoom: 15,
images: [
U.ImageOverlay(
// from url'http://img.freeflagicons.com/thumb/background_with_square_parts/indonesia/indonesia_640.png',
// can use bounds from all 4 corners
bounds: [
[-6.180143, 106.823504],
[-6.180344, 106.828948],
[-6.17162, 106.82938],
[-6.171958, 106.823674],
],
fit: BoxFit.cover,
),
U.ImageOverlay(
// from assets'assets/startrek.png',
// can use bounds from only 2 corners
bounds: [
[-6.17098, 106.825514], // latlng of bottom left corner
[-6.167775, 106.822867], // latlng of top right corner
],
)
],
)
Universe maps come with default controls: compass, locator, scale and location indicator. But we can override this controls with our own controls to make it align with our app theme.