AckerApple / agm-overlays

Custom marker overlay for the @agm/core package
MIT License
25 stars 24 forks source link

Add possibility to resize overlay while zooming #16

Closed vguleaev closed 6 years ago

vguleaev commented 6 years ago

Hi, you have a very usefull library that I plan to use in my project. But I need to slightly extend the overlay behavior. In my case I need the overlay image to be resized while scrolling (zooming). So I added it. Can you please review my pool request?

AckerApple commented 6 years ago

Thank you much so much. In my head, I have framed your kind words to memory for later proud self reflecting.

I have a few requests of this pull request:

Be good. Its a busy day but I can most likely get this pushed through once you address my requests above

vguleaev commented 6 years ago

Hello, thanks for willing to collaborate. I will do some changes soon. Hope you enjoy!

vguleaev commented 6 years ago

Hi again, another commit is made. I removed the resize property which is stupid because using an overlay you have 2 options:

  1. Display content in a single point (like you did) 2 Display content within bounds, so you want to specify 2 points, like a rectangle

Mostly we want to display something like markers but if you for example want to create custom zone html overlay. You want to paint exact area on the map with an gradient rectangle which is a bit transparent and has even animation.

So you create a custom overlay with that html for zone and specify real LatLang bounds to set the X and Y for a rectangle.

This is what I wanted to implement you can see working exmaple from google https://developers.google.com/maps/documentation/javascript/examples/overlay-simple

I also modified a bit code in "example" folder so you can see my changes, but you cant remove it.

check out my working demo which is used for my project https://jsfiddle.net/e3tb1rwg/13/ The left marker is custom overlay which is a div with gradient

AckerApple commented 6 years ago

Your second pull request is great. However, I had too many changes I wanted of it and too many syntax changes that I did not want of it. I cloned your pull request and took just the pieces that did the job and abandoned the rest.

You can see my commit here: https://github.com/AckerApple/agm-overlays/commit/5be4eabf0544deafa0b237639d3f6888cd9dc376

You can learn about how I implemented your request here: https://github.com/AckerApple/agm-overlays#zoom-sizing

I have NOT published this new version to npm. Version 1.3.0

Please test my commit and see if to your liking and will work for you. You only need to change lat and lng to latitude and longitude in your bounds. That's the only breaking change for you.

I know it's important to have pull requests accepted, you get credit in some fashion for it. I'm truly sorry that I am not pulling your pull request but I assure you, your code has been "accepted".

I do not need this code right now. But the whole open source is important to me. I have started my day off working for you before going to work. I hope this shows my dedication and appreciation of your code even though I didnt pull your code.

Thank you much. Please review and test the github version and if all is well, I will publish to npm

Feel free to express any thoughts you may have. Now that we've worked together I'm all ears for you

AckerApple commented 6 years ago

demo page was updated too, you can see one marker uses your bounds: https://ackerapple.github.io/agm-overlays/

vguleaev commented 6 years ago

Great work I saw your commit which is perfect the only thing I noticed is console.log() 👍

I am pleased that you accepted my changes. It was nice to work with you, hope official AGM team will accept your CustomOverlay library in future

AckerApple commented 6 years ago

I removed the console log. Great catch. I published to npm.

Mission accomplished!

Special request just for you: Please consider updating to a real github icon. I would like to remember those that I work with. I also have a lot of passion for the open source platform and being open is a part of that passion.

Hope to be seeing more of you. Be good