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

Markers not being removed from MarkerClusterer #153

Closed
ghost opened this issue Nov 19, 2015 · 3 comments
Closed

Markers not being removed from MarkerClusterer #153

ghost opened this issue Nov 19, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2015

Consider this example:

The Sydney marker should just stay in place, but after every even click, the cluster number increments.
I suspect that removing is not handled properly...

React               = require 'react'
{GoogleMap, Marker} = require 'react-google-maps'
MarkerClusterer     = require 'react-google-maps/lib/addons/MarkerClusterer'

Sydney =
    lat: -33.8539657
    lng: 150.9485251

ClusterDemo = React.createClass

    getInitialState: ->
        inside: false

    handleToggle: ->
        @setState
            inside: !@state.inside

    render: ->
        <div>
            <div>
                <Button onClick={@handleToggle}>Toggle</Button>
            </div>
            <div style={height: '200px', width: '600px'}>
                <GoogleMap
                        containerProps={{style: {height: '100%'}}}
                        defaultZoom={3}
                        defaultCenter={Sydney}
                    >
                    <MarkerClusterer ref="cluster">
                        {if @state.inside
                            <Marker position={Sydney} />
                        }
                    </MarkerClusterer>

                    {if !@state.inside
                        <Marker position={Sydney} />
                    }
                </GoogleMap>
            </div>
        </div>

module.exports = ClusterDemo
@ghost
Copy link
Author

ghost commented Nov 19, 2015

Why there are no tests for simple cases like this? @tomchentw

@tomchentw
Copy link
Owner

@11th welcome for some test cases! Ref #146, #96

@tomchentw
Copy link
Owner

Released v4.4.1

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

No branches or pull requests

1 participant