Coder Social home page Coder Social logo

ibrierley / flutter_map_line_editor Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 24.0 1.52 MB

A basic line/poly editor that works with flutter_map and dragmarkers.

License: MIT License

Dart 25.27% Kotlin 0.46% Swift 1.87% Objective-C 0.06% CMake 30.34% C++ 36.71% C 2.31% HTML 2.98%

flutter_map_line_editor's People

Contributors

erickrg avatar ibrierley avatar josxha avatar moovida avatar pablojimpas avatar shrijanregmi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_map_line_editor's Issues

Problem with editing line segment

Hi,

I am having trouble editing the last line segment of the polygon (line connecting point 1 and 3) for it cannot be extended or bent. Do you have a suggestion for fixing this problem?
polygon

Markers not dragging - again

Hi Ian,
We went thought this issue 2 years ago but now with updated Fluter and Map (3.0) I had problem to run LineEditor.
Originally I was using DragMaker from the package but they changed interface to I switched to yours.
It does compile but dragging does not work anymore ?
flutter_map_line_editor: ^4.0.2 flutter_map_dragmarker: ^4.1.2

Thanks for help in advance.

Question about color withOpacity

When I drag the marker, the transparency of the shape changed to opaque. I want it to keep transparent as it is. How can I fix this problem?

untitled

Drag marker does not update polygon points

import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_line_editor/flutter_map_line_editor.dart';

class _KmzMapState extends State<KmzMap> {
  PolyEditor? polyEditor;
  List<LatLng>? polygonToEdit;

  @override
  Widget build(BuildContext context) {
	return FlutterMap(
	  children: [
		TileLayer(...),

		// GestureDetector + PolygonLayer that instantiates polyEditor onTap of existing polygon:
		// polyEditor = PolyEditor(points: polygonToEdit!, callbackRefresh: () => setState(() {}))

		PolygonLayer(
		  polygons: [Polygon(
			color: Colors.purple,
			points: polygonToEdit!,
		  )],
		),
		// ...
		DragMarkers(markers: polyEditor!.edit()),
		// ... DragMarkers is the last layer, there is only a RichAttributionLayer after it
	  ]
	);
  }
}

In the screenshot, the drag marker can be interacted with, but it does not rebuild the PolygonLayer. No console output either, but callbackRefresh does get called.
image

Versions:
flutter_map: git+95ff0191981b87b24430ef434d7806e5a3017a50
flutter_map_dragmarker: 6.0.0
flutter_map_line_editor: 6.0.0

I am using bleeding-edge flutter_map as I require hit testing for the polygons. My app's map will be projecting multiple polygons that will be available to the user to edit and interact with as they please.

License?

This looks really interesting - thanks for publishing it. Please add a license file to the package.

no filled colors on polygon

Thanks for your awesome jobs. really appreciate your dedication.

Everything works on i wanted to, but only filled colors.
I did exactly same things with your examples. I don't know why polygons don't have filled colors.

any advice would be great. thanks.

Make icons be widgets?

Hi, would it be possible to let the handler icons be widgets? That would make it possible to have better visible effects for example by stacking 2 different color icons.

Moving Polygon/Polyline

Thanks for the great plugin, how I can move the polygon/polyline to another position by long press on it?

Inbetween point of a line not quite accurate on low zooms.

There's a quirk when using this on low zoom levels (I guess most people use a high zoom level for this) which I've never been quite happy with, and I feel like it should get fixed properly at some point.

Mid point markers can be offset slightly from their visual center. I suspect this is because of projections and a midway point of a LatLng isn't actually quite what we need. Again, we'll probably only notice this at low zoom levels where the effect is more pronounced.

I've tried a LatLngBounds.center, but actually I think this still has the same issue. What I suspect we need is actually to get the projection in pixels, so we have the screen space, then take the mid point, then unproject back into a LatLng.

If anyone fancies a challenge, it may be interesting to have a stab. This may need a bit more of a fundamental rejig, as I "think" it may need access to flutter_maps internals for the crs projection there, and original it was written to not need that.

Web support

Hi,
Your plugin is great and works great on Android/iOS.
How difficult is to make it work on Web too ?
Flutter_maps supports Web.
Thanks
Michal

null safety

So far I have only installed. Successfully. I had to remove flutter_map_dragmarker though because of:

[capturing] flutter pub get
Running "flutter pub get" in capturing...                       
Because every version of flutter_map_line_editor from git depends on flutter_map_dragmarker from git {url: https://github.com/ibrierley/flutter_map_dragmarker.git, ref: nullsafety, path: .} and capturing depends on flutter_map_dragmarker from git {url: https://github.com/ibrierley/flutter_map_dragmarker, ref: nullsafety, path: .}, flutter_map_line_editor from git is forbidden.

So, because capturing depends on flutter_map_line_editor from git, version solving failed.
pub get failed (1; So, because capturing depends on flutter_map_line_editor from git, version solving failed.)
exit code 1

But that will be fine once flutter_map_dragmarker is updated.

Next version

Please add support for flutter_map ^6.0.0
Because flutter_map_dragmarker >=5.0.0 depends on flutter_map ^5.0.0 and flutter_map_dragmarker <5.0.0 depends on latlong2 ^0.8.0, every version of flutter_map_dragmarker requires flutter_map
^5.0.0 or latlong2 ^0.8.0.

Performance issues

This code 'polyLines.add(testPolyline);' should not be placed in build(), because the build() method will be called multiple times, which will cause the testPolyline to be added multiple times and it can be placed in initState().
When multiple points are drawn and dragged several times, the map operation will become quite slow

Feature request: option to make start/end of polyline non-editable

I tried to take all but first and last marker, but it appears that they are ordered not along the line, but grouped by point type, so one would have to take that into account when deciding which points to remove, at which point this feels like I am getting too deep into implementation specific details of this library.

polyEditor.edit().sublist(1, polyEditor.edit().length - 2)

So I think it would be better if there is an option to disable the first and last marker. Perhaps two independent flags, as there may also be use cases where you only want to fixate one of the ends.

add this to pub.dev packages

thank you for this amazing package! but can you add it to pub.dev packages because when I try to install it , it show me error because I use others dependencies that use flutter_map from pub.dev not from GitHub like u use in this package

Polygon case

Hi, I finally have been able to test this plugin properly (thanks a ton for it).
While it works nicely for lines, I incurred in an issue for polygons. Let's see if I am able to explain it.

If I load the polygon using the right coordinates (i.e. first and last equal), I get this:
image
which has the following problem, if editing the startpoint:
image

I am thinking about a possible workaround but nothing clean comes to my mind. I think the best would be to remove the last point during editing and then add it back once editing finished (it is anyways the same as the first).

The problem is that while the drag markers should have one less, the editing Polyline shown below the markers, needs to be closed, else one edge is missing.

And since the two share the same list of coordinates in order to be able to "move" consistently during dragging... I have no idea what would be best to do here. Do you have any idea? :-)

FLUTTER_MAP RELATIONS: New Documentation

This message has been sent to multiple plugin authors, so it is not personalised

As part of fleaflet/flutter_map#992 & fleaflet/flutter_map#927 (reply in thread), I (a documentation author) am contacting plugin authors to ensure the information about this plugin on the new documentation is correct; or alternatively, if this plugin is not yet on the existing list, to check whether you would like to add your plugin to the new documentation.

I would also like you to check you conform to these new rules:

  • this plugin is available via a pub.dev installation to make it easier for developers - if your plugin does not currently have a pub.dev page, please add one or let me know otherwise,
  • the plugin documentation includes enough information for installation and basic setup/functionality,
  • the plugin includes a runnable example and/or screenshots,
  • the plugin description contains the words ' - IN BETA' after the author link on the same line if your plugin is in beta,

Currently I have copied over the existing plugin descriptions, and you can see these here: https://flutter-map.vercel.app/plugins/list. Please note that this documentation is currently unapproved and should not be used unless otherwise directed, as some information may be incorrect or missing, or might change in the future. There is no ETA at the moment, but things seem to be moving along.

Should you wish for the description to remain the same as current on the page linked above, you do not have to reply, you can close this issue.

If you wish to change any information, please leave this issue open and add your reply as a comment.

flutter_map maintainers do not take any responsibility for this message, I am the sole author.

On behalf of myself and the flutter_map community thank you for your excellent plugin :).

hardcoded DragMarker size

Hi, I am trying to make the dragmarker size a user setting, so that one can choose it depending on the device (phone, tablet or pc).
Since I am using containers with decoration to make the handlers, I was experiencing issues with making the marker small (this didn't happen with the icons).

Then I saw that:

          DragMarker(
            point: this.points[indexClosure],
            width: 40.0,
            height: 40.0,

this width and height are hardcoded. Might this be the issue?
Is there a reason you chose to put here the size? Wouldn't the size come directly from the child widget? I am sure missign something here. Thanks for any insight.

Markes not dragging

Hi,
This plugin is really great but I can't make markers to drag. My map structure:

  _flutterMap = FlutterMap(
      options: _mapOptions,
      mapController: _mapController,
      layers: [
        _mapStyle == MAP_STYLE_STREETS
            ? new TileLayerOptions(
                urlTemplate:
                    "https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",
              )
            : new TileLayerOptions(
                urlTemplate:
                    "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}.jpg"),
        new PolygonLayerOptions(
          // concatenat ecurrent list with selected
          polygons: _polygonsList,
        ),
        new MarkerLayerOptions(
          markers: _markersList,
        ),
        new MarkerLayerOptions(
          markers: _currentPosition != null ? [_currentPosition] : [],
        ),
        new DragMarkerPluginOptions(markers: _polyEditor.edit()),
      ],
    );

And MapOptions:

    _mapOptions = new MapOptions(
      // if position not known yet set center of US.
      center: _position != null
          ? LatLng(_position.latitude, _position.longitude)
          : LatLng(38.576525, -121.493217),
      zoom: _zoom,
      onTap: (_tapPosition, _latLng) => handleTap(_latLng),
      onPositionChanged: (position, hasGesture) =>
          handleMove(position, hasGesture),
      plugins: [
        DragMarkerPlugin(),
      ],
    );

I get polyline with markers, I think I can even add new marker to the line but dragging does not work at all :(.
Thanks

Is a point inside of polygon?

This great package could be even more exciting if it allows to check if a custom point (a marker coordinates, a touch, a physical address, whatelse) is inside or outside a polygon, for instanse, using geodesy package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.