Usuario anónimo  |  Ingresar  |  Regístrate
Mensaje dentro Bugs and Improvements

Marker Server Event not firing

Responder 
#1 - 15/01/2010 16:16:29 Reporta abuso | Link permanente
greyhound
Fecha de registro: 08/01/2010
10 posts en todos los foros
Marker Server Event not firing

Responder Citar
Using your code in example:
http://en.googlemaps.subgurim.net/Foro/ayuda-post687.aspx#691

Does not work.

Please can you let me know what I need to do in order to raise a server event when a marker is dragged.
Volver arriba

Respuestas
De en 15
#2 - 28/01/2010 19:08:23 Reporta abuso | Link permanente
greyhound
Fecha de registro: 08/01/2010
10 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
No, I dont want a full app I just want some advice on how to use the control

For anyone that is interested there is a better control which is free over at reimers.dk

It doesnt have a memory leak, its free, the forum works properly and the help and advice is really good.
Volver arriba

#3 - 26/01/2010 9:12:49 Reporta abuso | Link permanente
subgurim
Fecha de registro: 18/10/2006
2003 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
greyhound ha dicho:

1. Need a single marker that can be dragged
2. When the marker is dragged I want to look up against a database
3. I want to panto the spot where the marker is dragged to
4. I want to plot the database points as marker on the map
5. I would like to update a datagrid with database values


Wow, what you want is a full app ;)

I think it could be done using both client events (3) and server events with ASP.NET Postback (4 and 5)
Volver arriba

#4 - 22/01/2010 16:02:32 Reporta abuso | Link permanente
greyhound
Fecha de registro: 08/01/2010
10 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
Not really...

I shall explain again:

1. Need a single marker that can be dragged
2. When the marker is dragged I want to look up against a database
3. I want to panto the spot where the marker is dragged to
4. I want to plot the database points as marker on the map
5. I would like to update a datagrid with database values

Thanks
Volver arriba

#5 - 21/01/2010 12:18:56 Reporta abuso | Link permanente
subgurim
Fecha de registro: 18/10/2006
2003 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
Hi,

Are you setting the serverEventType to ASP.NET PostBack (http://en.googlemaps.subgurim.net/ejemplos/ejemplo_999999_ASP_NET_Postback.aspx).

As far as I understand reading your code your are trying to change the GMap1 object and return a javascript... you cannot do both things at the same time.

If you want to change the GMap1 object you should use serverEventType/ASP.NET PostBack.

If you only want to return a javascript, use the normal serverevent.

Does it solve your problem?
Volver arriba

#6 - 20/01/2010 12:28:20 Reporta abuso | Link permanente
greyhound
Fecha de registro: 08/01/2010
10 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
Any news on this - I really need to get this working and cannot see why it is not.

Also is there anyway of subscribing to a forum post otherwise it is not possible to know when a post has been replied to.

Thanks.
Volver arriba

#7 - 19/01/2010 18:09:46 Reporta abuso | Link permanente
greyhound
Fecha de registro: 08/01/2010
10 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar

In my serverside event I have the following which is called:

Now.... the js variable is getting returned to the map as the map is centering wherever my marker is dragged to.

The problem is that none of the other serverside code is getting fired. The data retrieval logic is fine as I have tested it out via a button which calls a regular c# method.

It is only when I try and use the code from within the serverEvent function.

Please could you advise. (and please not just a quick link to one of your examples as they do not contain real life examples that I need) As a trade I can post my code when I have finished my project. It will be very useful to those starting from scratch like me.

Thanks.

switch (e.eventName)
{
case "markerDragged":
GMap1.resetMarkers();
GMap1.reset();
GMap1.enableServerEvents = true;
//add our draggable marker back into the mix
GMarkerOptions mOpts = new GMarkerOptions();
mOpts.draggable = true;
mOpts.bouncy = true;
mOpts.title = "Drag me to find your spot";
GMarker mkr = new GMarker(latlng, mOpts);
GMap1.Add(mkr);
GMap1.addListener(new GListener(mkr.ID, GListener.Event.dragend,
string.Format(@"
function(marker, point)
{{
var ev = new serverEvent('markerDragged',{0});
ev.addArg(this.getPoint());
ev.send();
}}", GMap1.GMap_Id)));

DataSet dsParkingSpaces = dataRetrieval.getParkingSpacesForGoogle(lng, lat, distanceSearch);
GMap1.DataLatField = "Latitude";
GMap1.DataLngField = "Longitude";
GMap1.DataBind();
js = string.Format("{0}.panTo(new GLatLng({1}, {2}, {3}))", e.who, lat, lng, 15);
break;
}
return js;


switch (e.eventName)
{
case "markerDragged":
GMap1.resetMarkers();
GMap1.reset();
GMap1.enableServerEvents = true;
//add our draggable marker back into the mix
GMarkerOptions mOpts = new GMarkerOptions();
mOpts.draggable = true;
mOpts.bouncy = true;
mOpts.title = "Drag me to find your spot";
GMarker mkr = new GMarker(latlng, mOpts);
GMap1.Add(mkr);
GMap1.addListener(new GListener(mkr.ID, GListener.Event.dragend,
string.Format(@"
function(marker, point)
{{
var ev = new serverEvent('markerDragged',{0});
ev.addArg(this.getPoint());
ev.send();
}}", GMap1.GMap_Id)));

DataSet dsParkingSpaces = dataRetrieval.getParkingSpacesForGoogle(lng, lat, distanceSearch);
GMap1.DataLatField = "Latitude";
GMap1.DataLngField = "Longitude";
GMap1.DataBind();
js = string.Format("{0}.panTo(new GLatLng({1}, {2}, {3}))", e.who, lat, lng, 15);
break;
}
return js;

Volver arriba

#8 - 19/01/2010 8:41:18 Reporta abuso | Link permanente
subgurim
Fecha de registro: 18/10/2006
2003 posts en todos los foros
RE: Marker Server Event not firing

Responder Citar
What's the error with this example?
Volver arriba
De en 15

Powered by Subgurim.NET