AckerApple / agm-overlays

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

Style InfoWindow #26

Open newprogrammer1991 opened 5 years ago

newprogrammer1991 commented 5 years ago

Hello, Can I style infowindow like this ? Please help! image

AckerApple commented 5 years ago

agm-overlays allows for custom html

In my code, I just use an absolute positioned element that is revealed on click. I do not use the InfoWindow of agm-core. I do not use the snazzy window that I've seen other people use as an option in agm-core. I just trust in my own html abilities to write my own floating element.

Good luck to you. TIP: I typically have an element with position:relative and then inside that element I have a position:absolute element with like a top:0 or bottom:0 to make my floating element appear above or below my marker.

newprogrammer1991 commented 5 years ago

thank you! Can I style agm ? for example <agm-overlay [ngStyle]="{'z-index':i===activeId ? '200': 'auto'}> or add class ?

AckerApple commented 5 years ago

No

And with that question, I feel you don’t understand

Your html code, including your hide/show floating window, would go inside an agm-overlay tag

The demo code for this package has something of the sorts. Perhaps tomorrow I could dig you up an example

newprogrammer1991 commented 5 years ago

I did it by html and css! Thank you!

newprogrammer1991 commented 5 years ago

Do I need use fitbounds method with cluster or cluster make all what I need? (I get coords array from api) Please help!

AckerApple commented 5 years ago

I use clustering a lot in my production code, however it’s been a little time since my last use and it’s a lazy Sunday...

For now,

Here is a link to the demo code that uses clustering (overlay tags seem to have a bounds attr): https://github.com/AckerApple/agm-overlays/blob/master/example/src/app.template.ts#L27

If you continue to have issues, I’ll look up my production usages for you

newprogrammer1991 commented 5 years ago

Sorry! I know about bound attribute in agm overlay, before when I use agm-core only , I made fitbounds for example : let bounds: google.maps.LatLngBounds = new google.maps.LatLngBounds(); bounds.extend(new google.maps.LatLng(this.location.lat, this.location.lng)); this.objMap.fitBounds(bounds); So , I don't know how right use it, like before or calculate bound for your attr( I haven't found formula)

newprogrammer1991 commented 5 years ago

Please help!

AckerApple commented 5 years ago

I can't. I'm busy. I tried typing this message out several times, I can't figure out what to communicate nor what to ask.

With a name like "newprogrammer" and my names not "greatteacher", I can't with you