PDA

View Full Version : Can't draw polyline on google map in ExtJs 4



dagotodros
10 Jan 2012, 4:33 AM
Hi. I use ExtJS 4 with GMapPanel3. When I use method addPolyline I see error message - "An invalid or illegal string was specified" code: "12". What I do wrong?

mitchellsimoens
10 Jan 2012, 10:53 AM
I moved this to the Q&A forum.
Can't know what you did wrong with not know what you did. Although this is probably an issue for google maps not Ext JS 4.

dagotodros
12 Jan 2012, 12:54 AM
I use plugin by VinylFox (http://www.sencha.com/forum/member.php?12-VinylFox) for google map - GMapPanel3. And when I use method addPolyline I see error message - "An invalid or illegal string was specified" code: "12".
This code window with map.

function showMap(){ $.post('scripts/show_general_settings.php',function(data)
{

if(!mapwin){

var values=data.split("/n");
mapwin = Ext.create('Ext.Window', {
layout: 'fit',
title: 'Google карта',
closeAction: 'hide',
width:600,
height:600,
border: false,
x: 40,
y: 60,
items: [{
xtype: 'gmappanel',
id: 'mymap',
zoomLevel: parseInt(values[4]),
gmapType: 'map',
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl'],
setCenter: {
lat:49.0321,//values[2],
lng:24.433829999999944//values[3]
}
}
]
});






mapwin.show();
});

}

This code add polyline

$.post('scripts/Monitoring.php',{array_of_imei:car_data,CurrTime:'2011-11-29 17:08:14',PrevTime:'2011-11-29 17:07:14'}, function(data) {
points=data.split("\n");
$.each(points,function(key,value)
{
point=value.split("\t");
var point_line = new Object();
point_line.lat=point[0];
point_line.lng=point[1];
data_point.push(point_line);

});
var map_googl=Ext.getCmp('mymap');
map_googl.addPolyline(data_point,{strokeColor: '#FF0000',strokeOpacity: 1.0,strokeWeight: 6} );