Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    26
    Vote Rating
    0
    pulliags is on a distinguished road

      0  

    Default Adding Marker to Ext.Map in Sencha Architect 2

    Adding Marker to Ext.Map in Sencha Architect 2


    Hopefully this is a simple answer...for some reason I can't seem to create a Marker on an Ext.Map in Sencha Architect 2. What I have done is create an Ext.Map view as part of a Navigation View. I've also created a Controller Action for the maprender event called onMapMaprender. Inside the onMapMaprender function I'm able to setMapCenter using the getLocation function from the CityBars example. What I'm not able to do is create a marker for this same location. I've tried several options with no success (see commented out code in function below). If anyone has any suggestions I would love to know how to do this in Sencha Architect 2. As you can see below, I'm trying to set the marker after centering the map. Thanks!!

    onMapMaprender: function(map, gmap, options) {
    var me = this;
    me.getLocation(function (location) {
    map.setMapCenter({
    latitude: location.coords.latitude,
    longitude: location.coords.longitude
    });

    //var point = new google.maps.LatLng(
    // location.coords.latitude,
    // location.coords.longitude
    //);

    //new google.maps.Marker({
    // position: point,
    // map: map,
    // draggable: false,
    // animation: google.maps.Animation.DROP
    //});

    //var marker = new google.maps.Marker({
    // position: map.center,
    // title : 'Infofactory HQ',
    // map: map
    //});
    //infowindow.open(map, marker);
    //google.maps.event.addListener(marker, 'click', function() {
    // infowindow.open(map, marker);
    //});

    var infoWindow = new google.maps.InfoWindow(),
    point = new google.maps.LatLng(
    location.coords.latitude,
    location.coords.longitude
    ),
    marker = new google.maps.Marker({
    map: map,
    position: point
    });
    });

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    London
    Posts
    392
    Vote Rating
    16
    digeridoopoo will become famous soon enough

      0  

    Default Me too...

    Me too...


    I would be interested in this too....

    In my Sencha Touch v1 app I have multiple markers, looped through like this with code parts from github:

    Code:
      initializeCountries();
            for (var i=0; i < countryInfos.length; i++) {
            addMarker(countryInfos[i]);
          };
    and then to create the markers I had this function:

    Code:
    function addMarker(country) 
                {
            if (true) 
                    {
              var image = new google.maps.MarkerImage(country.image48Path);
              var marker = new google.maps.Marker({
                map: map.map,
                title: country.title,
                position: country.position,
                //draggable: true,
                icon:image
              });
    ...then for one of the markers (I had several) I used this:

    Code:
    var euroInfo = new countryInfo(
                          49.55373, 15.55664, //coordintes
                        'Europe', //countryname
                        'European-Union-Flag-', //startofflagfilename
                        '61,838,154', //population
                        '$2,174,530,000,000', //GDP
                        '$41,520', //GNI
                        '80'); //lifeexpectancy
    I would love to try and adapt this for Architect but not sure how to go about it. I'm not sure I understand the override part yet, have you tried anything with the override button in the code view?

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    26
    Vote Rating
    0
    pulliags is on a distinguished road

      0  

    Default


    No, I haven't tried an override yet. Not really sure when to use that anyway. I'm stil new to all this, so was hoping to do something simple like create a marker on the Ext.Map with my current location. Here's what I've tried this morning...taping a button on one view and then calling the Ext.Map view. After getting the location from the getLocation function, I'm able to set the map center, but still unable to add the marker...or it's at least not showing in the center of the map as I would expect. The maprender should have already fired.:

    Code:
        onMapButtonTap: function(button, e, options) {
            var me = this,
                map,
                lat,
                long,
                loc,
                marker,
                info, details;
            //if (record) {
            details = Ext.create('MyApp.view.MyMap', {
                title: 'Bill Map'
            });
            // set the map
            //map = details.child('#detailMap');
            //lat = record.get('latitude');
            //long = record.get('longitude');
            details.setMapOptions({
                zoom: 18
            });
            me.getLocation(function (location) {
                details.setMapCenter({
                    latitude: location.coords.latitude,
                    longitude: location.coords.longitude
                });
                var infoWindow = new google.maps.InfoWindow(),
                    point = new google.maps.LatLng(
                    location.coords.latitude,
                    location.coords.longitude
                    ),
                    marker = new google.maps.Marker({
                        map: details,
                        position: point
                    });
                google.maps.event.addListener(marker, "click", function() {
                    infoWindow.setContent('test');
                    infoWindow.open(details, marker);
                });
            });
    
            //me.getLocation(function (location) {
            //    details.setMapCenter({
            //        latitude: location.coords.latitude,
            //        longitude: location.coords.longitude
            //    });
            //    
            //    details.addMarker(location);
            //});
            me.getMainNav().push(details);
            //}
        },

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    26
    Vote Rating
    0
    pulliags is on a distinguished road

      0  

    Default


    Ok...I was able to finally get a marker on my map...here is the code for the Map Button that I created on one view that then pushes the Ext.Map in a navigation view while adding the marker. What I find interesting is that when I put the maprender code below in a Controller Action or Basic Event Binding it doesn't appear to work. It only appears to work when I add the listener per the below code. Not sure what I'm doing wrong in the other instances.

    Code:
        onMapButtonTap: function(button, e, options) {
            var me = this;
    
            me.getLocation(function (location) {
                button.up('navigationview').push({
                    xtype: 'mymap',
                    title: 'My Map',
                    listeners: {
                        maprender: function(comp, map) {
                            var position = new google.maps.LatLng(
                            location.coords.latitude, 
                            location.coords.longitude
                            ); 
                            var marker = new google.maps.Marker({
                                position: position,
                                map: map,
                                animation: google.maps.Animation.DROP
                            });
                            google.maps.event.addListener(marker, 'click', function() {
                                console.log(marker.position);
                                infowindow.open(map, marker);
                            });
                            setTimeout(function() {
                                map.panTo(position);
                            }, 100);
                        }
                    }
                });
            });
          },

  5. #5
    Sencha User
    Join Date
    Sep 2013
    Posts
    1
    Vote Rating
    0
    tahirkhan056 is on a distinguished road

      0  

    Default Here is the solution

    Here is the solution


    Use the following code to display marker on mapRender function. I also have the same problam now its work for me

    onMymapMaprender: function(map, gmap, eOpts) {
    var map= map.getMap();


    var locations = [
    ['Bondi Beach', -33.890542, 151.274856, 4],
    ['Coogee Beach', -33.923036, 151.259052, 5],
    ['Cronulla Beach', -34.028249, 151.157507, 3],
    ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
    ['Maroubra Beach', -33.950198, 151.259302, 1]
    ];


    var myLatlng = new google.maps.LatLng(-33.92, 151.25);
    map.setCenter(myLatlng );
    var infowindow = new google.maps.InfoWindow();
    var marker, i;


    for (i = 0; i < locations.length; i++) {
    marker = new google.maps.Marker({
    position: new google.maps.LatLng(locations[i][1], locations[i][2]),
    map: map
    });


    google.maps.event.addListener(marker, 'click', (function(marker, i) {
    return function() {
    infowindow.setContent(locations[i][0]);
    infowindow.open(map, marker);
    }
    })(marker, i));
    }
    marker.setMap(map);
    }

Thread Participants: 2