Results 1 to 4 of 4

Thread: Ext.map mapListener not return mouseevent

    Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1

    Default Ext.map mapListener not return mouseevent

    Touch version tested: 2.30

    Browser versions tested against:Chrome 32.0.1700.102 , Safari 7.0.1

    DOCTYPE tested againstHTML

    Description:I would like to detect a map tap using Ext.map on iOS / Android. The map config includes an option for mapListeners which should map to the events listed on google's docs. The click listeners should pass the mouseevent as a parameter, instead it passes the map panel itself. This allows me to detect a click / tap, however I can't do anything useful with it because it doesn't have the mouseevent properties like the latLng object.

    Steps to reproduce the problem:

    Ext.define('App.view.mainMap', {
    extend: 'Ext.Map',
    xtype: 'mainMap',
    config: {
    title: 'Map',
    useCurrentLocation: true,
    layout: 'fit',
    id: 'mainMap',
    mapListeners: {
    "click": function(event) {
    console.log(event);
    }
    },
    mapOptions: {
    zoomControl: true,
    panControl:false,
    rotateControl: false,
    streetViewControl: false,
    zoom:14,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    navigationControl:true,
    navigationControlOptions: {
    style: google.maps.NavigationControlStyle.DEFAULT,
    },
    }
    }
    });


    The result that was expected: It is expected to receive the mouseevent as the callback parameter

    The result that occurs instead: The callback returns the map panel:

    _activeItem: 0
    _baseCls: "x-map"
    _control: objectClass
    _disabledCls: "x-item-disabled"
    _flex: 12
    _floatingCls: "x-floating"
    _geo: Class
    _hiddenCls: "x-item-hidden"
    _id: "mainMap"
    _itemId: "mainMap"
    _items: Class
    _layout: "fit"
    _map: Ol
    _mapListeners: objectClass
    _mapOptions: Object
    _styleHtmlCls: "x-html"
    _useCurrentLocation: true
    bodyElement: Class
    config: objectClass
    element: Class
    eventDispatcher: Class
    getEventDispatcher: function () {
    getObservableId: function () {
    getUniqueId: function () {
    heightLayoutSized: true
    id: "mainMap"
    initConfig: function (){}
    initialConfig: Object
    initialized: true
    innerElement: Class
    innerItems: Array[0]
    items: Class
    layoutStretched: true
    managedListeners: Object
    mapContainer: Class
    observableId: "#mainMap"
    onInitializedListeners: Array[0]
    onItemAdd: function () {
    parent: Class
    referenceList: Array[3]
    refreshFloating: function () {
    refreshSizeState: function () {
    renderElement: Class
    rendered: true
    sizeFlags: 7
    sizeState: true
    usedSelectors: Array[1]
    widthLayoutSized: true
    __proto__: Object

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Remove the quotes from around click. Should be:
    Code:
    click: function (event) {
        console.log(event);
    }
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3

    Default Not fixed

    Quote Originally Posted by fmoseley View Post
    Remove the quotes from around click. Should be:
    Code:
    click: function (event) {
        console.log(event);
    }
    The event is firing, its just not returning the mouseevent, its returning the mappanel itself. I can't access the lat(), lng() positions of where the user clicked

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    150

    Default

    Set up the map listener in the maprender event whose second parameter is the Google map.
    Code:
    google.maps.event.addListener(map, "click", function (e) {
           alert(e.latLng.toString());
    });

Tags for this Thread

Posting Permissions

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