1. #1
    Ext User
    Join Date
    Oct 2010
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
    Roller89 is on a distinguished road

      0  

    Default google api geolocation in a sencha tab

    google api geolocation in a sencha tab


    Hi guys!
    now im defo very new to programming and wonder how can a google map with geolocation
    into one of the tabs in the example "tabs"
    I've tried this code but when I open my app in a web browser and choose this tab it says "Google Maps API is required"
    Code:
    {
                 xtype: 'map',
    				title: 'Map',
    				getLocation: true
                },
    can someone help me with this, I need to build an app that can locate different restaurangs which I'll manually add with pins and a small info popup into the map.

    thanks guys this project rocks!

    /Vik

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    328
    Vote Rating
    12
    Stuart-SwarmOnline will become famous soon enough Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    Have you included the Google API files?

    Code:
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

  3. #3
    Ext User
    Join Date
    Oct 2010
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
    Roller89 is on a distinguished road

      0  

    Default


    No I haven't but I've added them now and it works like a charm thanks a lot man!
    one more thing though I need to ask, how can I add multiple pins to the map? would be great to point out some
    places!, where do I need to put the cordinates?


    thanks once again!

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    328
    Vote Rating
    12
    Stuart-SwarmOnline will become famous soon enough Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    Code:
    var location = new google.maps.LatLng(latitude, longitude);
    
                var marker = new google.maps.Marker({
                    map: this.map,
                    title: 'Marker Title',
                    position: location
                });
    That will add a marker, so do some looping around that. Check out the Google Maps API (v3) for more examples and all the docs.

  5. #5
    Ext User
    Join Date
    Oct 2010
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
    Roller89 is on a distinguished road

      0  

    Default


    cheers man! I've looked at google "my maps" and I've added some spots with information, but I need to get "my map" into my app, that's my problem now. how do I do that? where do I get the source code for that?

    thanks once again I know Im a newbie

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    328
    Vote Rating
    12
    Stuart-SwarmOnline will become famous soon enough Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    I'm not sure i understand what you mean when you're talking about "my maps" - can you explain a bit more?. You should just be able to your Ext.Map object into a panel in your app.

  7. #7
    Ext User
    Join Date
    Oct 2010
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
    Roller89 is on a distinguished road

      0  

    Default


    sorry man for my english and lack of programming skills!
    I want the pins to drop down when you start the application
    it should be really simple and look something like this http://www.youtube.com/watch?v=piGIlkpwX54 is there any premade code from google
    which allows me to just add the pins to the map?

    thanks

Similar Threads

  1. Google Analytics Use in Sencha Touch?
    By Steve Lewis in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 27 Nov 2012, 7:42 AM
  2. Replies: 2
    Last Post: 9 Sep 2010, 10:24 AM
  3. HOW to use rss in panel like Google AJAX Feed API - Google Code
    By koko2589 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 28 Jun 2009, 2:53 AM
  4. (SOLED)Yahoo BOSS API Or Google API Implementation
    By anshubansal2000 in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 23 Jan 2009, 5:48 AM

Thread Participants: 1