I create a marker with an icon, but the position of the icon is not in the top-right where the perfect place it should be, So how to set position offset for a marker.
I searched a while and found a raw solution, it's not work after the a mouse scrolling. when I zoom in the map, the icon moves far beyond the original position.
here is my code
const marker = L.marker(eaPoint.position, {
icon: L.icon({
iconUrl: ICONS.ruby,
iconSize: [30, 40],
}),
riseOnHover: true,
data: eaPoint.data,
})
It works with the iconAnchor attribute, I should have read the documentation.
const marker = L.marker(eaPoint.position, {
icon: L.icon({
iconUrl: ICONS.ruby,
iconSize: [30, 40],
iconAnchor: [0, 30]
}),
riseOnHover: true,
data: eaPoint.data,
})
Related
Im using google_map_flutter for implementing map,but i need to use the property jointype of polyline and i changed the jointype to round but it doesnot make any change. The exact use of polyline is for i need to curve the joints of polyline whenever turn occurs.
Polyline(
polylineId: const PolylineId('seg1'),
points: routes,
jointType: JointType.round,
geodesic: false,
color: Colors.blue,
width: 10,
)
enter image description hereI have created a 430-radius circle on Google Maps.
I want one functionality when I click outside of the circle radius then the message shows you are out of the zone.
If I clicked within the circle then I want to show the message you are in your zone.
I have created a 430-radius circle on Google Maps and I compared the latitude and longitude of my current location.
In OnTap I have shown on e Toast message you are in your zone.
The problem is when I press out of the circle the message shows you are in your zone.
Same when I clicked within the circle same message showed.
I have used the if-else statement but I can't achieve the functionality which I want.
final List _list = [
Marker(
markerId: MarkerId('1'),
position: LatLng(25.00057631014206, 55.297173890099394),
draggable: false, onDragEnd: (updatedLatLng) {
// checkUp(updatedLatLng);
}),
//position: LatLng(latSelected, lngSelected),
];
Set circles = Set.from([
Circle(
circleId: CircleId('1'),
center: LatLng(25.00057631014206, 55.297173890099394),
radius: 700,
strokeWidth: 2,
// strokeColor: Color(0xFFB2DEFF),
fillColor: Color(0xFFE4F0F9).withOpacity(0.5))
]);
There is a method onTap(LatLng) on google maps it will give you lattitude and longitude coords from parameters.
You can check from there whether the current coords are inside the circle or not.
I'm using sleek_circular_slider package, but i don't know how to be
the widget as circle, by default it is not
final slider = SleekCircularSlider(
appearance: CircularSliderAppearance(
customWidths: CustomSliderWidths(progressBarWidth: 10)),
min: 10,
max: 28,
initialValue: 14,
);
The package documentation states that the slider object takes an appearance parameter of type CircularSliderAppearance. You can then set angleRange as a parameter on the appearance to get whatever range you require. By default docs state it is 240 degrees.
To get a complete circle, the code would look something like:
final slider = SleekCircularSlider(
appearance: CircularSliderAppearance(angleRange: 360),
onChange: (double value) {
print(value);
});
I'm trying to change the color of the legend text when a serie is unselected/not shown in echarts.
Using the legend.textStyle.color option, I am able to change the text color but only when the serie is shown.
However I can't seem to find a similar option for when the serie is not shown.
For example the settings:
legend: {
top: '10%',
textStyle: {
color: 'red'
}
}
results in the following (with series medium and high not selected)
But I'd like medium and high shown in a darker color
Am I missing it or is it just not there?
I've tried setting the color to an array (color: ['red', 'blue']) but that didn't work.
you can use inactiveColor:"red",
something like below
legend: {
data: [{name: 'Email',
inactiveColor:"red",
textStyle:{
color:'green'
},
itemStyle: {
//color: ['red', 'green'],
color: '#ccc',
borderType: [50, 10],
}}, 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
},
I need to create polygons on the Google map dynamically in flutter. I could plot polygons with known points but I couldn't draw the polygons dynamically Please help...
I also need to draw a polygon point by point.
To do this, in the onTap handler
GoogleMap(
polygons: Set<Polygon>.of(mapsPolygons.values),
onTap: tapMap,
...
)
I add a marker and write each tap down to the List<LatLng>.
Then I update the map, with the rendered polygon
Map<PolygonId, Polygon> mapsPolygons = <PolygonId, Polygon>{};
List<LatLng> mapsPolygons = [];
void tapMap(LatLng pos) {
final PolygonId polygonId = PolygonId("Polgon_1");
final Polygon polygon = Polygon(
polygonId: polygonId,
strokeColor: Colors.red,
strokeWidth: 5,
fillColor: Colors.red.withOpacity(0.3),
points: polygonPoints,
);
mapsPolygons[polygonId] = polygon;
//setState((){});
}
i update the map using StreamBuilder() but it should work with setState() too
example
P.S. Sorry for my English