-
18 Nov 2012 1:21 PM #1
Unanswered: map in galaxy note
Unanswered: map in galaxy note
hi guys ,
when i display the map on my mobile , its not displaying very well , find the screen shot please
Screenshot_2012-11-18-22-59-22.jpg
Code:var map1 = Ext.create('Ext.Map', { title : 'Map', id: 'google-map-id', layout : 'fit', flex:1 }); Ext.define('landmarks.view.landmark.Path', { extend: 'Ext.Container', xtype: 'landmark-path', config: { layout: 'vbox', items: [ { id: 'content', tpl: [ '<div>', '<div >{lname_e} </span></div>', '</div>' ].join('') }, map1 ], record: null }, updateRecord: function(newRecord) { if (newRecord) { this.down('#content').setData(newRecord.data); Ext.device.Geolocation.getCurrentPosition({ allowHighAccuracy: true, success: function(position) { latitude = position.coords.latitude longitude = position.coords.longitude ; var start = new google.maps.LatLng(latitude, longitude); var end = new google.maps.LatLng(newRecord.data.lat, newRecord.data.lng); var request = { origin:start, destination:end, travelMode: google.maps.DirectionsTravelMode.WALKING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); }, failure: function() { Ext.Msg.alert('Geolocation', 'Something went wrong!'); } }); } } });
can you help me please
regards
-
18 Nov 2012 2:13 PM #2
fire change size on map
fire change size on map
Usually it helps if you fire a size change event on the map.
That way it tells google maps to update the map
-
18 Nov 2012 2:58 PM #3
how to "fire change size on map " ? would you please post some script
-
19 Nov 2012 2:43 AM #4
Code:google.maps.event.trigger(SenchaMap.getMap(), 'resize');
-
19 Nov 2012 3:13 AM #5
thanks for help , i found this solution here http://www.sencha.com/forum/showthre...ce-Orientation
and i added to the view , but it does not work , i'm sorry , would u tell me where i should add the script line ?
BR
-
19 Nov 2012 4:37 AM #6
Add it to the geocoder update method if a map is currently displayed (depends on the frequency of your geolocator (Ext.util.Geolocation).
An alternative could be to fire it 500ms after orientation change or after showing the map.
-
19 Nov 2012 7:24 AM #7
this is not working , also im getting the following errorHTML Code:var map1 = Ext.create('Ext.Map', { title : 'Map', id: 'google-map-id', layout : 'fit', flex:1, listeners: { maprender : function(map, gmap, options){ // Ext.Function.defer(function(){ google.maps.event.trigger(component.googleMap.map, 'resize'); }, 500); } } });
PHP Code:Uncaught ReferenceError: component is not defined Path.js:95Ext.device.Geolocation.getCurrentPosition.successPath.js:95Ext.apply.listeners.locationupdateSimulator.js:17Ext.define.doFireController.js:197Ext.define.fireController.js:124Ext.define.doDispatchEventDispatcher.js:341Ext.define.dispatchEventDispatcher.js:322Ext.define.doFireEventObservable.js:235Ext.define.fireEventObservable.js:194Ext.define.fireUpdateGeolocation.js:356(anonymous function)
-
19 Nov 2012 7:42 AM #8
is it bug ? or problem from Galaxy note , or problem in my script ?
is this problem fixed in 2.1 ?
-
20 Nov 2012 5:33 AM #9
excuse me , but really this forum is not active like other forums , i face a problem , and i need to solve it , i have tried manything , can you help me please ?
-
23 Nov 2012 4:59 AM #10
I am sorry you are not getting help. But this usually is a cross mix between not-enough-info posted and not being able to understand the problem.
Here are some thoughts:
1) What are you using layout: 'fit' for?
2) Put an alert into the maprender listener and see at what time it is firing. Is this the time when you need it to fire? Does the map exist at that point in the creation process?
3) The listener gives you a gmap. What is that good for. Could you use it inside the defer?
4) When the defer is triggering the resize event, is the map still or already there?


Reply With Quote
