Basejumper.com - archive

Suggestions and Feedback

Shortcut
Profile Location
When you put in a location, if you move the map... the pin follows the center of the map (not the pre-determined location)
Shortcut
Re: [AndrewKarnowski] Profile Location
AndrewKarnowski wrote:
When you put in a location, if you move the map... the pin follows the center of the map (not the pre-determined location)

Yeah... I wonder why Google did it like that?
Shortcut
Re: [sangiro] Profile Location
Your Code:

Code
<!--- Map Start ---> 

<div align="center">
<div id="map2" style="width: 300px; height: 150px; border: solid 1px; #DDD;"></div>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAA_-RD-O7nooUyw7-e4ic3ExQQqA5PaaIckF-UfWcKOJB1qhCgBhSPg0b_ntoJfbAHA55A4NBCrDp_vA" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[

// define the icons
var fillFields = false;
var smallIcon = new GIcon();
smallIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
smallIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
smallIcon.iconSize = new GSize(12, 20);
smallIcon.shadowSize = new GSize(22, 20);
smallIcon.iconAnchor = new GPoint(6, 20);
smallIcon.infoWindowAnchor = new GPoint(5, 1);

function mapload() {
// Make the map and add controls
var map = new GMap(document.getElementById("map2"));
GEvent.addListener(map, "moveend", function() {
var center = map.getCenterLatLng();
map.clearOverlays();
createMarker(map, new GPoint(center.x, center.y), "", smallIcon, "", 1)
if( fillFields ) {
var lat=Math.round(center.y*100000)/100000;
var lon=Math.round(center.x*100000)/100000;
document.object_attributes.elements['user_latitude'].value = lat;
document.object_attributes.elements['user_longitude'].value = lon;
}
else { fillFields = true; }
//var latLngStr = '(' + center.y + ', ' + center.x + ')'; //DEBUG
//document.getElementById("message").innerHTML = latLngStr; //DEBUG
});
map.setMapType(G_MAP_TYPE);
map.addControl(new GMapTypeControl());
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(-96.5662, 39.1782), 15);

}

// Creates a marker and a listener so that the
// info window pops up when you click the marker
function createMarker(map, point, label, icon, hovertext, isopen) {
if (icon) {
var marker = new GMarker(point, icon);
}
else {
var marker = new GMarker(point);
}
map.addOverlay(marker);
}

//]]>

</script>

<!--- Map End --->



Change this:

Code
createMarker(map, new GPoint(center.x, center.y), "", smallIcon, "", 1)


To this:

Code
createMarker(map, new GPoint($variable_long, $variable_lat), "", smallIcon, "", 1)



Why you gotta blame google for your inadequacies as a programmer? ;-) ;-)
Shortcut
Re: [AndrewKarnowski] Profile Location
Now, implement your solution somewhere on a small map, like the one I have and use it to fill the lat/lng fields.... then try both and se which one navigates the easiest...

See, on a small map window where the marker can move with the map the user will quite readily, easily and often 'loose' the marker outside the visible area of the map when they start moving the map around and the marker goes with it. Less of a problem on a large map area.

I tried them both. On a small map, I prefer this solution. No inadequacies, I just think your solution is wrong for this application. Smile
Shortcut
Re: [sangiro] Profile Location
how is it wrong? Crazy

am I mistaken on these two points?


the purpose of the marker:
- show the location of the jumper

what it currently does:
- shows the center of the map