Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's work together #130

Closed
wants to merge 84 commits into from
Closed

Let's work together #130

wants to merge 84 commits into from

Conversation

Loown
Copy link

@Loown Loown commented Feb 3, 2022

Hi, sorry for this unconvenient PR but I see that @vorokami did a big job on upgrading the capacitor plugin on his own.

I'm asking now if @voromaki could help improving this plugin so every capacitorJS developers can use it, I see that you worked on clusters, that would be a appreciated feature.

Sorry to bother you if you'r not interrested but at least I tried !

this method needs id of marker like for removeMarker() and
preferences for marker like for addMarker()
Writing much code, trying copy android code and design of touch
delegation
Added a structure with folders
Added class CustopTomViewController
trying to use ViewController instead of simple View
worked on the solution for problem:
html element or mapView was touched for
sending touch to html view or mapView
"cover map with HTMLElements" for iOS - solved
I added overlayView and using it I calculate the touch
if this touch point contains html element than
view with html elements is on
in another case view with html elements is off and
touches pass through this view to map
this methods turn on/off user interaction with UIViews of maps
add method getArrayHTMLElements()
add method setArrayHTMLElements()

couples of methods to get and set touchable areas
of html buttons on top of the maps
this function let return JSObject from class object
1. changed names of this methods
2. solved bug for setter
Added the library 'Google-Maps-iOS-Utils' (pod) to the project
'CapacitorCommunityCapacitorGooglemapsNative'
This is done by adding this dependency to file
CapacitorCommunityCapacitorGooglemapsNative.podspec
working: addMarker(), addMarkers(),
dont working: updateMarker(), removeMarker()
this files are for storing file information
on the MacOS
this files have appeared from working with
MacOS and accidentally will be committed
this command will delete them
find . -type f -name '._*' -delete
added variable google-api-key to android plugin to in future will make
map initialization using outer maps api key in js code
marker icon - default
cluster icon - new purple icon
color of text of number of markers in cluster - dark purple
map appear and disappear but not blocking
dont sure it will be good working solution
I haven't succeeded yet block map or mapView, because delegateTouchEvent
simple ways dont blocking the map
now it is working.
i added variable isHidden for mapView and don't delegateTouchEvents is
its true
method for adding markers in bulk
after every adding single marker, the method cluster() of ClusterManager
is called.
with this new methods cluster() is called only once for bunch of markers

Method cluster() force a re-cluster on the map. I should call this after
adding, removing, updating, or clearing item(s).
now icons of markers show up under the icons of cluster

It's help in the case when cluster dont disappear and marker appear on
the same spot and here is one sec delay before disappearing of cluster
icon is happened.
added support for different icons of markers according category of
marker
here is 29 marker-categories by number of images in
src/main/assets/marker-categories
0 category is for default marker with title "default"
this 5 images was full-sized in folder
resized them to 50x50 px and compressed them
split the package utils to maputils and utils
this field will not change for the entire work of the programm
this method allow adding new marker category to the map
adding id category (int), title category (string) and base64 image icon
(string, only image bytes)
@selected-pixel-jameson
Copy link

@Loown First off, thank you for starting this conversation. I think the potential problem is that, in my opinion, these are not really pulls and more completely different versions. I've done a significant amount of work as well and I'm not sure how to go about getting that all into this one repo either.

@Loown
Copy link
Author

Loown commented Feb 3, 2022

@Loown First off, thank you for starting this conversation. I think the potential problem is that, in my opinion, these are not really pulls and more completely different versions. I've done a significant amount of work as well and I'm not sure how to go about getting that all into this one repo either.

Didn't really meant to merge this, just trying to get @vorokami attention about trying to offer his work into community plugin.

Now, the important thing, is to know if @hemangsk is trying to improve his module or, if the doesn't, maybe, giving it to someone that could take care of it

I would really appreciate to see this module maintained and improved

(I'm learning Java to work on android features, but my knowledges aren't enough atm)

changed couple params in multi_profile.xml - xml params of cluster icon
in OwnIconRenderer made instances of IconGenerator for every
"bucket", for every size of icons of clusters
to class CustomMarker added static method for getting info about
CustomMarker
(before this method was only for Marker obj)
when zoom level is max and cluster still on the map method
CapacitorGoogleMaps.didTapCluster() returning in result info
about markers inside
added values for unclustering animation bounding box
height and width they equals 4/5 of mapView rect
@vorokami
Copy link

vorokami commented Feb 6, 2022

Hi everyone, @Loown @selected-pixel-jameson. Sorry for waiting answer from me - Its was unexpected for me. I just made fork of this fork https://github.com/DutchConcepts/capacitor-google-maps/tree/next
of capacitor google maps native plugin, initially only for try to solve this
#84
(I created my own solution for this. Maybe not the best solution, and its different on ios and android, but its working)
And later on my own I added couple more features for working project, that using this plugin, like clustering and marker categories

In sum, Im added bunch of features and made refactoring of initial code, and now I don't know easy way merge this.
Okey, if someone can make good use of that stuff that I made, then in some time I will try to do pull requests into community plugin with one my feature at a time.

And for my repo I still will be using it for my working app, so I will formalize my repo: add my personal readme file, docs about my functions that I added, how use it in web component

@tafelnl
Copy link
Member

tafelnl commented Feb 8, 2022

This is going to be one hell of a job to merge correctly. I think the best way is to merge it into the next branch in our DutchConcepts fork. Like this

But since you based your branch on top of https://github.com/capacitor-community/capacitor-googlemaps-native/tree/master I honestly think this is going to be impossible. We should probably just check every change and see what we can do

added method CustomMarker.getJSONForClusterItem
and method CustomMapViewController.getResultForCluster - its method called only if unclustering is happening
overrided func shouldRender (as cluster: )
added TODO for working on animation later
now only exact count of markers as text
… id to marker preferences

now all calls for id of marker use getter marker.id
in web component get or set id of marker now is 'id' and not 'markerId'
deleted method getJSONForClusterItem() and little changed method getResultForMarker() for clusterItem
at the moment, markers and clusters of the google map belong to
ClusterManager. So, this class is handles events of clicks on
marker(cluster item) and click on clusters

old simple markers and so old MarkerClick now dont working, now it is
ClusterItems

added handles for  ClusterItemClick and ClusterItemInfoWindowClick
new JSON of returning values:
position:
  mapId
  latitude
  longitude
marker:
  metadata
  id
  iconId
renamed events and callbacks
now everything that was ClusterItem now Marker
and everything that was Marker now SingleMarker
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants