-
21 Nov 2011 11:21 AM #1
Unanswered: Maps with sencha touch
Unanswered: Maps with sencha touch
I am trying to create an application that will display current location on the map. But I am not able to display my current location. I am trying standard map example from sencha examples. When I try it online it works but not on my local system. I am using chrome for testing.
-
21 Nov 2011 11:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
- Answers
- 3153
Code?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Dec 2011 2:24 PM #3
since the topic starter left I will continue this thread:
I want to show my current location in a sample app.
My index.html:
and the app.js:Code:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Sample app</title> <script type="text/javascript" src="lib/touch/sencha-touch-all-debug.js"></script> <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript"> Ext.Loader.setConfig({ enabled : true, path : { PPL : 'ppl.js' } }); Ext.setup({ tabletStartupScreen : 'tablet_startup.png', phoneStartupScreen : 'phone_startup.png', icon : 'phone_startup.png', onReady : function() { Ext.create('PPL.App', { fullscreen : true }); } }) </script> </head> <body> </body> </html>
But, sadly nothing happens, I only see the toolbar with the title.Code:Ext.define('PPL.App', { extend : 'Ext.Panel', config : { items : [{ xtype : 'toolbar', docked : 'top', title : 'Sample MAP' },{ xtype : 'panel', height : 300, width : 400, items : [{ xtype : 'map', useCurrentLocation : true }] }] } });
Did I forgot to use layouts properly?
Thanks
EDIT: I think topic started asked question also on Stackoverflow: http://stackoverflow.com/questions/8...364070#8364070Last edited by aacoro; 2 Dec 2011 at 3:41 PM. Reason: stackoverflow reference
-
3 Dec 2011 2:46 PM #4
There were issues with Map in PR2. A lot of work has been on on Map and GeoLocation for the next release.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
3 Dec 2011 4:26 PM #5
I need this for a test case within one month, 2nd of january.
Can you define 'next'? Within one month? Week? Year?
Thanks.
-
3 Dec 2011 4:26 PM #6
PR3, next week, hopefully.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
4 Dec 2011 7:37 AM #7Sencha - Training Team
- Join Date
- Nov 2009
- Location
- Washington, DC
- Posts
- 34
- Vote Rating
- 0
- Answers
- 1
There's a workaround -- basically you just need to set all the map properties directly through the Google Maps API:
HTML Code:Ext.define("CrimeFinder.view.crimereport.map.Map", { extend: 'Ext.Map', xtype: 'crimemap', config: { useCurrentLocation: false }, initialize: function() { var me=this; var gMap = this.getMap(); gMap.setOptions({ center : new google.maps.LatLng(38.909085, -77.036777), zoom : 16, mapTypeId : google.maps.MapTypeId.ROADMAP, navigationControl : true, navigationControlOptions : { style : google.maps.NavigationControlStyle.DEFAULT } }) } });
-
4 Dec 2011 10:55 PM #8


Reply With Quote
