So here's the situation: I have a class called Map which is a child of GMapPanel. I want to place markers on the map based on data loaded into MapIncidents via JSON. Now, I know I can't do that during the initialization of Map because the JSON request inside MapIncidents* is asynchronous and therefore not ready yet. So instead, I added a listener to Map inside Incidents so that when the data had loaded it would execute a method inside Map that would add markers to the map. To make things extra complicated, I'm also using a class called markerclusterer to add clustering to the map when zoomed out.
Now I have the code doing all this, BUT for some weird reason it appears to be adding double markers, i.e. the clustering says that there are 2 markers right on top of each other.
Don't know what I'm doing wrong, so I would appreciate a little help here. I'll stick my code in some pastebins.
Map.js (view) -> http://pastebin.com/9xtBYYKt
MapIncidents.js (store) -> http://pastebin.com/uJnHkBSm
Incidents.js (controller) -> pastebin.com/tjEc2xT5
GMapPanel.js (slightly modified) -> pastebin.com/W7LTxV9s
markerclusterer.js (taken from google amps) -> pastebin.com/SiUkLhW2
Incident.js (model)
Ext.define('SF.model.Incident', {
extend: 'Ext.data.Model',
fields: ['incident', 'lat', 'lng']
});