PDA

View Full Version : How refresh mapPanel?



kevinv1990
11 Jan 2011, 6:59 AM
Hello all,

I Want to refresh the map so new markers etc will be shown on the map. Also when a value in the json changes (an location) the marker must be on another spot, i use a datastore which i can update with datastore.update, but i can't find out how to update the mapPanel so it will refresh and show the new markers.


Greetz Kevin

kevinv1990
12 Jan 2011, 12:36 AM
Did read the google api of maps v3, nothing seems to work directly, there is some sencha code i need to use for the reload?

kevinv1990
12 Jan 2011, 2:12 AM
Okay, I think this is not the way it must go, but it works, that's for sure.


// Update datastore & location
datastore2.update();
geo.updateLocation();

// Refresh map
var mapToRefresh = icams.mapPanel.getComponent('map1');
mapToRefresh.rendered = false;
mapToRefresh.render();

Have Fun

prinzpixel
25 Jul 2011, 2:27 AM
cool.. it works with your solution, but is there no other way to refresh the map?

jrboddie
25 Jul 2011, 6:25 AM
Try this:

myMap.update(location); where myMap is the object from Ext.Map()