Page 32 of 33 FirstFirst ... 2230313233 LastLast
Results 311 to 320 of 324

Thread: Ext.ux.GMapPanel - Google Maps

  1. #311
    Sencha User
    Join Date
    Jan 2011
    Posts
    12

    Default

    Quote Originally Posted by VinylFox View Post
    Working fine for me...

    Yes, provide more detail, do some debugging.
    Here's what I get from recenter-map page:
    Screenshot-4.jpg

    Note: I have controlled everything about libraries and .js locations, there's no problem with that. And I couldn't find any problem while debugging code. I'm trying to integrate it with extjs version 3.3.1. I think problem arises because of extjs version inconveniences...have you tested it with extjs 3.3.1?

  2. #312
    Sencha User
    Join Date
    Jan 2011
    Posts
    12

    Default Custom icon for a marker...

    I've already started using gmaps v2 extension. But now I want to replace standard G_Default_Icon with my own .png icon file (it has image and shadow)...Here's a code that I have tried but there's no markers when I click my addMarker button:

    Code:
    var point = new GLatLng(latitude.getValue(),longitude.getValue());
                  
                        var image = new google.maps.MarkerImage(
                          'hospitals.png',
                          new google.maps.Size(48,48),
                          new google.maps.Point(0,0),
                          new google.maps.Point(24,48)
                        );
                        
                        var shadow = new google.maps.MarkerImage(
                          'shadow.png',
                          new google.maps.Size(76,48),
                          new google.maps.Point(0,0),
                          new google.maps.Point(24,48)
                        );
                        
                        var shape = {
                          coord: [29,3,32,4,34,5,35,6,37,7,38,8,39,9,40,10,40,11,41,12,42,13,42,14,43,15,43,16,44,17,44,18,44,19,44,20,44,21,44,22,44,23,44,24,44,25,44,26,44,27,44,28,44,29,44,30,43,31,43,32,42,33,42,34,41,35,40,36,40,37,39,38,38,39,37,40,35,41,34,42,32,43,29,44,18,44,15,43,13,42,12,41,10,40,9,39,8,38,7,37,7,36,6,35,5,34,5,33,4,32,4,31,3,30,3,29,3,28,3,27,3,26,3,25,3,24,3,23,3,22,3,21,3,20,3,19,3,18,3,17,4,16,4,15,5,14,5,13,6,12,7,11,7,10,8,9,9,8,10,7,12,6,13,5,15,4,18,3,29,3],
                          type: 'poly'
                        };
                        
                        var marker = new google.maps.Marker({
                          icon: image,
                          shadow: shadow,
                          shape: shape
                        });
                        
                        
                        
                        Ext.getCmp('my_map').addMarker(point,marker, false, false, undefined);

    Any suggestions?

  3. #313

    Default How to add a map click event

    I am trying to add a click event to the gmappanel3 , but it seems not working for me.

    The following code is not working for me.

    var map =Ext.getCmp("my_map").getMap();

    google.maps.event.addListener(map, 'click', function() {
    Ext.Msg.alert("map clicked");
    // infowindow.open(Ext.getCmp(mapCmp).getMap(),marker);
    });
    I am trying to add the code to the example
    http://ukypssgis.ca.uky.edu/landusen...er-layout.html


    Could some one show me the correct code

    Thank you

  4. #314
    Sencha Premium User karlsnyder0's Avatar
    Join Date
    Mar 2010
    Location
    Maryland, USA
    Posts
    92

    Default Problem with GMapPanel3

    Hello-

    I am using GMapPanel3 with ExtJS 3.3.1 and I am having a problem. I get a blue screen when I run the tabs example. Do you have any ideas as to what is causing this? There are no JavaScript errors reported in the Chrome debugger.

    screenshot_119.jpg
    Please note that the example is taken directly from git.

    Thanks for your help,

    Karl

  5. #315
    Sencha User
    Join Date
    Jul 2011
    Posts
    23

    Default

    Hi,

    I tried to make VinylFox / ExtJS.ux.GMapPanel work with TabPanel but its behavior is weird. Map panel occupies only small part of tab. When I move a map it flickers and dissapear for a while and then appear once again as a smart rectangle in a corner.

    It works perfectly in windows as examples show but not with Ext.tab.Panel.

    Anyone knows a solution ?
    Best regards, kkris1983

  6. #316
    Sencha User
    Join Date
    May 2010
    Posts
    1

    Default Listener bug in GMapPanel?

    When i use the setCenter config options with geoCodeAddr , the listeners is working fine.
    Code:
    setCenter:
    {
    geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA', marker:
    {
    title: 'Fenway Park'
    }, listeners: {
    click: function() {
    Ext.Msg.alert({title: 'Hello', text: 'World!'});
    }
    }
    },
    After a change the geoCodeAddr to lat-lng, the listener do not works any more.
    Code:
    setCenter:
    {
    lat: 0.0, lng: 0.0,
    {
    title: 'North Pole'
    }, listeners: {
    click: function() {
    Ext.Msg.alert({title: 'Hello', text: 'IceCube!'});
    }
    }
    },
    So, i changed the afterRender function at line 74 in the GMapPanel.js
    Code:
    if (typeof this.setCenter.marker === 'object' && typeof point === 'object'){
    // Original line:
    // this.addMarker(point,this.setCenter.marker,this.setCenter.marker.clear);
    // and I changed:
    this.addMarker(point,this.setCenter.marker,this.setCenter.marker.clear,true,this.setCenter.listeners);
    }
    Now everything works fine.

    Sorry, my english is terrible, but i hope you will be understand it.

  7. #317
    Ext JS Premium Member
    Join Date
    Jul 2011
    Posts
    8

    Default

    Hello All,

    I am working on getting the google map markers displayed in the EXTJS window and a table in a grid panel below the gmap window. I want to click on the marker and select a record based on the location of the marker. When I click on the marker, the scope is not changing from Window.

    How do I change the scope so that when a click happens, it goes to the grid and then i find the record based on the marker position?

    Is there any other way which is easier apart from scope? Basically I want to get the record and display it in grid.
    Please let me know, thank you much in advance.

  8. #318

    Default

    Hi,

    I am trying to open info panel base on click on particular bubble on Map. I can see the marker's title when I keep pointer on particular bubble. But when I am executing click event on bubble it always give me last created bubble's title. Code is as below.

    Code:
    for(var i in mapResults) {
              var markerTitle = mapResults[i].site_name; 
              var latitude = mapResults[i].site_lat;
              var longitude = mapResults[i].site_long;
    
    
              if(mapResults[i].site_name){
                markerTitle = mapResults[i].site_name;
              }else{
                markerTitle = 'Test 1';            
              }
              if(mapResults[i].site_lat){
                  latitude = mapResults[i].site_lat;
              }else{
                latitude = 30.992254;
              }  
              if(mapResults[i].site_long){
                  longitude = mapResults[i].site_long;
              }else{
                longitude = -70.030728;
              }
    
    
              var markerOptions = {
                  lat: latitude,
                  lng: longitude,
                  marker:{title:markerTitle},
                  listeners: {
                    click:function(markers){
                    alert('site_external_id='+mapResults[i].site_external_id);
                    alert('title'+this.markers[i].marker.title);
                    alert('lat='+this.markers[i].lat);
                    }
                  }
              }
              markersArray.push(markerOptions);
          }
          
    var googleMapLoad = new Ext.ux.GMapPanel({
                            xtype: 'gmappanel',
                            id : 'gSiteMapLoad',
                            width:'100%',
                            height:800,
                            zoomLevel: 5,
                            gmapType: 'map',
                            mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
                            mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
                            setCenter: {
                              geoCodeAddr: 'Silver Spring, 20910, MD',
                              marker:{ title: 'Test 007'}
                            },
                            markers:markersArray
                        });
    Issue is when ever I click the bubble, listener will take " i " the object but the value of " i " is last value of increment. So, The click always gives me last object not the " i " the object.

    -Ankit

  9. #319
    Ext JS Premium Member
    Join Date
    May 2008
    Location
    Austria, Vienna
    Posts
    265

    Default

    Welcome to javascript variable scoping!
    Google for that and you will find the solution.

  10. #320

    Default

    I am aware of that global & local variable , and that's why we should have some other variable to hold other than lat,lng and title.

    Right now when you click the bubble, you will see objects like this, markers(which is THE bubble), closing scope, objects window(or similar).

    Now that marker object having lat & lng value as x,y, Ia, Vd.

    which is
    Code:
    var markerOptions = {
                       lat: latitude,
                       lng: longitude,
    ......
    We should have other variable to hold/keep uniqueness of that marker object, like id. or Some other similar concept.

    Anyway, I got the solution , the markerOptions is as follow.

    Code:
    var markerOptions = {
    
    
                  //id:  sId,
                  lat: latitude,
                  lng: longitude,
                  marker:{title:markerTitle},
                  listeners: {
                    click:function(markers){
                    for(var k=0;k<tempMapResult.length;k++){
                     if(tempMapResult[k]){
                     if(tempMapResult[k].site_lat && tempMapResult[k].site_long){
                      if(tempMapResult[k].site_lat==markers.y && tempMapResult[k].site_long==markers.x){
                        var bubbleSiteId = tempMapResult[k].site_id;
                        var bubbleSitStatus = tempMapResult[k].site_status;
                        var bubbleSiteAccess = tempMapResult[k].site_access;
                      
                        addSmallRemoveBigMap(bubbleSiteId,bubbleSitStatus,bubbleSiteAccess);
                        break;
                      }
                     }
                     }
                    }
                    }
                  }
              }
    -Ankit

Page 32 of 33 FirstFirst ... 2230313233 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •