Displaying 12 results from an estimated 12 matches for "setcenter".
2009 Jan 21
7
Panning map to a point vs. setCenter
Several map providers have functions to pan to a location, as opposed
to the direct setCenter call. Panning animates the move from one point
to another. To implement this in mapstraction, I created a panCenter
function.
I don''t know how to go about committing the change to svn, or who
decides whether my naming convention is worthy, but I thought I''d
share the func...
2010 Jan 13
8
How to use getCenter
Hi,
I am starting to use Mapstraction with the openlayers provider, and I am not
sure how to retrieve the current center of a map in a cross-provider way.
i.e. currently when calling map.getCenter(), the result returned is the
openlayers internal one, not the long/lat used when calling setCenter().
Is that the expected behaviour?
Regards,
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100113/a2beecf9/attachment.htm>
2007 Jan 18
1
Clusterer generating javascript syntax error
...''m loading in the requisite javascript libraries,
including clusterer and mapstraction, and then displaying the map with
something like:
<%= session[:gmap].div(:width => 600, :height => 400) %>
However, I get this Javascript error when I view my page:
illegal character
30map.setCenter(new
GLatLng(38.134557,-95.537109),4);map.addOverlay(#<Ym4r::MapstractionPlugin::Clusterer:0x9b3d608>);map.addControl(new
GLargeMapControl());
It seems pretty obvious that a Ruby object reference is somehow
getting inserted into the generated Javascript. Removing the clusterer
lines from my c...
2007 Mar 09
0
(no subject)
..."/images/
gm_shadow.png",infoWindowAnchor : new GPoint(9,2),shadowSize : new
GSize(37,34),iconSize : new GSize(20,34)});var map;
window.onload = addCodeToFunction(window.onload,function() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_div"));
map.setCenter(new GLatLng(47.7377071331,-2.9257965088),10);
map.setCenter(new GLatLng(47.7377071331,-2.9257965088),
10);GEvent.addListener(map,"click",function processMoveEndEvent()
{ var centerPoint = map.getCenter(); });
map.addOverlay(new GMarker(new GLatLng(47.7377071331,-2.9257965088),
{title...
2007 Mar 09
0
Clusterer
...gm_shadow.png",infoWindowAnchor : new GPoint(9,2),shadowSize : new
GSize(37,34),iconSize : new GSize(20,34)});var map;
164 window.onload = addCodeToFunction(window.onload,function() {
165 if (GBrowserIsCompatible()) {
166 map = new GMap2(document.getElementById("map_div"));
167 map.setCenter(new GLatLng(47.7377071331,-2.9257965088),10);
168 map.setCenter(new GLatLng(47.7377071331,-2.9257965088),
10);GEvent.addListener(map,"click",function processMoveEndEvent()
{ var centerPoint = map.getCenter(); });
169 map.addOverlay(new Clusterer([addDescriptionToMarker
(addInfoWindowT...
2009 Sep 20
0
r30 committed - jslint now passing for google and googlev3
...: this.addSmallControls();
+ if (args.zoom == ''large''){
+ this.addLargeControls();
+ } else {
+ this.addSmallControls();
+ }
}
if (args.scale) {
@@ -184,7 +186,7 @@
setCenter: function(point, options) {
var map = this.maps[this.api];
var pt = point.toProprietary(this.api);
- if(options && options[''pan'']) {
+ if(options && options.pan) {
map.panTo(pt);
}
else {
@@ -357,7 +359,7 @@
mousePosition: function(elemen...
2007 Mar 08
1
map not displayed after Ajax.updater request
...",iconAnchor : new GPoint
(10,34),shadow : "/images/gm_shadow.png"
,infoWindowAnchor : new GPoint(9,2)});
..........
var map;
window.onload = addCodeToFunction(window.onload,function() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_div"));
map.setCenter(new GLatLng(47.7500161647,-2.916641656),
8);GEvent.addListener(map,"click",function processMoveEndEvent
() { var centerPoint = map.getCenter(); if (map.getZoom() <= 18)
{ processNewMapMovement()} });
map.addOverlay(contact);
map.addOverlay(reference);map.addControl(new GSmallMapCo...
2009 Jun 01
0
[mapstraction commit] r12 - Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays
...true;
},
dragging: function(on) {
var map = this.maps[this.api];
- // TODO: Add provider code
+ if (on) {
+ map.enableDragging();
+ } else {
+ map.disableDragging();
+ }
},
setCenterAndZoom: function(point, zoom) {
@@ -61,22 +85,17 @@
addMarker: function(marker, old) {
var map = this.maps[this.api];
var pin = marker.toProprietary(this.api);
-
- // TODO: Add provider code
-
+ map.addOverlay(pin);
return pin;...
2007 Oct 16
3
can''t define custom GIcon
Hi,
I am having trouble getting custom GIcons to display. Here is the code in
my controller:
@map = GMap.new("map_div")
@map.control_init(:large_map => true,:map_type => true)
@map.icon_global_init(GIcon.new(:image => "images/APBox-20.png
"),"ap_none")
infoString = "Friendly Name: "+result.friendly_name+
2007 Mar 04
0
Event listeners
...p.overlay_init @marker1
@map.center_zoom_init([@latitude, @longitude],16)
@map.event_init(@map,:click,"function(){alert(''HOYOYO'');}") #
this runs well... testing..
@map.event_init(@marker1, :dragend, "function () { point =
marker1.getPoint(); map.setCenter(point); map.savePosition();
GLog.write(''New position of insert = ''+ point.lat() + '',''+
point.lng()); });")
# this one doesn''t fire up..... as it does in rjs
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL:...
2007 Mar 04
0
Event listeners.. solved
...o helpful...)
and I got it (maybe not so good writing..
@map.declare_init(@marker1, ''marker1'')
@map.overlay_init(@marker1)
@map.record_init "GEvent.addListener(marker1, ''dragend'',
function () {
point = marker1.getPoint();
map.setCenter(point);
map.savePosition();
GLog.write(''New position of insert = ''+ point.lat() + '',''+
point.lng()); });"
it runs... could not find the solution without init_record... but
at least I found one solution..
Yves
2010 Nov 08
1
API Google MAPS
....lng();
//document.getElementById("Latitud").innerHTML =
marker.getPosition().lat();
//document.getElementById("lng").value =
marker.getPosition().lng();
//document.getElementById("lat").value =
marker.getPosition().lat();
//map.setZoom(1);
map.setCenter(marker.getPosition());
});
}
</script>
<body onload="initialize()">
.
.
.
</body>
in the view for the form:
<tr>
<th scope="row"><%= I18n.t("tog_conclave.fields.lat") %></th>
<td nowrap="nowrap&quo...